FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Off Topic / Otros temas WebX from xBasePHP
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
WebX from xBasePHP
Posted: Sat Jan 10, 2026 05:43 PM

My honest opinion on the subjects of other posts, without undermining their achievements, I'm working my self more than on a tool, on preserving the Harbour/FiveWin syntaxy's (Both jewels conceived by our Dear Antonio Linares), that was what it brought all of us into FiveWin from Clipper to begin with.

If nobody was able to make most Fivewiners to migrate from .dbf files, who will make them to migrate to the unknown web. I hate .CSS for starters... LOL

For the experts, you will see that the samples do not work 100% accuratly,,, is still on the works... but is not a fake... just a proof of concept....

/*
 * my_box_title.prg - Demo of WebX Classes
 * 
 * Demonstrates the new web-styled container and title bar controls
 * Compatible with Harbour/FiveWin Language* 
 * (c) MayaPOS 2026 - WebX Framework
 */

#include "WebX.ch"

FUNCTION Main()
    LOCAL oWnd
    LOCAL oTitle1, oTitle2, oTitle3
    LOCAL oBox1, oBox2, oBox3
    LOCAL oSay1, oSay2, oSay3, oSay4, oSay5, oSay6
    LOCAL oBtn1, oBtn2

// Create main window with light background 
DEFINE WINDOW oWnd ;
    TITLE "TMyBox and TMyTitle Demo - WebX Framework" ;
    SIZE 1200, 800

//--------------------------------------------------------------------------
// Page Title with Modern Gradient
//--------------------------------------------------------------------------
oTitle1 := TMyTitle():New( oWnd, 10, 20, 1160, 60, ;
    "WebX Framework - Modern UI Components", ;
    CLR_WHITE, ;                    // Text color
    nRGB( 65, 84, 241 ), ;         // Primary #4154f1
    nRGB( 44, 54, 135 ), ;         // Gradient end #2c3687
    NIL, ;                          // Style
    NIL, ;                          // Font
    .F., ;                          // Horizontal gradient
    .T., ;                          // Border
    nRGB( 65, 84, 241 ), ;         // Primary border #4154f1
    .F. )                           // Glass effect

//--------------------------------------------------------------------------
// Section 1: Info Box (Light Blue)
//--------------------------------------------------------------------------
oBox1 := TMyBox():New( oWnd, 90, 20, 360, 250, ;
    "Customer Information", ;
    CLR_WHITE, ;                       // Title text color
    nRGB( 64, 153, 255 ), ;           // Info #4099ff
    nRGB( 207, 244, 252 ) )           // Info light #cff4fc

@ 130, 40 SAY oSay1 PROMPT "Name: John Doe" SIZE 300 COLOR nRGB(66, 66, 66) TO oWnd
@ 160, 40 SAY oSay2 PROMPT "Email: john@example.com" SIZE 300 COLOR nRGB(66, 66, 66) TO oWnd
@ 190, 40 SAY oSay3 PROMPT "Phone: (555) 123-4567" SIZE 300 COLOR nRGB(66, 66, 66) TO oWnd
@ 220, 40 SAY PROMPT "Status: Active Customer" SIZE 300 COLOR nRGB(46, 202, 106) TO oWnd

//--------------------------------------------------------------------------
// Section 2: Success Box (Green)
//--------------------------------------------------------------------------
oBox2 := TMyBox():New( oWnd, 90, 400, 360, 250, ;
    "Sales Statistics", ;
    CLR_WHITE, ;                       // Title text color
    nRGB( 46, 202, 106 ), ;           // Success #2eca6a
    nRGB( 224, 248, 233 ) )           // Success light #e0f8e9

@ 130, 420 SAY PROMPT "Total Sales: $125,450" SIZE 300 COLOR nRGB(66, 66, 66) TO oWnd
@ 160, 420 SAY PROMPT "Orders: 342" SIZE 300 COLOR nRGB(66, 66, 66) TO oWnd
@ 190, 420 SAY PROMPT "Average: $366.81" SIZE 300 COLOR nRGB(66, 66, 66) TO oWnd
@ 220, 420 SAY PROMPT "Growth: +23.5%" SIZE 300 COLOR nRGB(46, 202, 106) TO oWnd

//--------------------------------------------------------------------------
// Section 3: Warning Box (Orange)
//--------------------------------------------------------------------------
oBox3 := TMyBox():New( oWnd, 90, 780, 400, 250, ;
    "Recent Notifications", ;
    CLR_WHITE, ;                       // Title text color
    nRGB( 255, 119, 29 ), ;           // Warning #ff771d
    nRGB( 255, 236, 223 ) )           // Warning light #ffecdf

@ 130, 800 SAY PROMPT "• New order received" SIZE 350 COLOR nRGB(66, 66, 66) TO oWnd
@ 160, 800 SAY PROMPT "• Payment processed" SIZE 350 COLOR nRGB(66, 66, 66) TO oWnd
@ 190, 800 SAY PROMPT "• Shipment dispatched" SIZE 350 COLOR nRGB(66, 66, 66) TO oWnd
@ 220, 800 SAY PROMPT "• Customer feedback received" SIZE 350 COLOR nRGB(66, 66, 66) TO oWnd

//--------------------------------------------------------------------------
// Secondary Title
//--------------------------------------------------------------------------
oTitle2 := TMyTitle():New( oWnd, 360, 20, 560, 60, ;
    "Information Panel", ;
    CLR_WHITE, ;
    nRGB( 1, 41, 112 ), ;          // Secondary #012970
    nRGB( 65, 84, 241 ), ;         // Primary #4154f1
    , , ;
    .F., ;                          // Horizontal gradient
    .T., ;
    nRGB( 1, 41, 112 ), ;          // Secondary border
    .F. )

@ 440, 40 SAY PROMPT "Dark to bright gradient" SIZE 500 COLOR nRGB(66, 66, 66) TO oWnd
@ 470, 40 SAY PROMPT "with semi-transparent appearance." SIZE 500 COLOR nRGB(66, 66, 66) TO oWnd

//--------------------------------------------------------------------------
// Danger Title (with glass effect)
//--------------------------------------------------------------------------
oTitle3 := TMyTitle():New( oWnd, 360, 600, 580, 60, ;
    "Reports & Analytics", ;
    CLR_WHITE, ;
    nRGB( 220, 53, 69 ), ;         // Danger #dc3545
    nRGB( 176, 42, 55 ), ;         // Darker danger
    , , ;
    .F., ;                          // Horizontal gradient
    .T., ;
    nRGB( 220, 53, 69 ), ;         // Danger border
    .T. )                           // Glass effect enabled

@ 440, 620 SAY PROMPT "Danger/alert color with glass effect" SIZE 500 COLOR nRGB(66, 66, 66) TO oWnd
@ 470, 620 SAY PROMPT "combining gradient and transparency." SIZE 500 COLOR nRGB(66, 66, 66) TO oWnd

//--------------------------------------------------------------------------
// Action Buttons (direct syntax - works now)
// @ BUTTON transpiler fix working but hits BUG #128 (goto label) in webx_mybox
//--------------------------------------------------------------------------
oBtn1 := TButton( 520, 20, "Refresh Data",, oWnd, 180, 40,, .T. )
oBtn2 := TButton( 520, 220, "Close Demo",, oWnd, 180, 40,, .T. )

//--------------------------------------------------------------------------
// Information Footer
//--------------------------------------------------------------------------
@ 580, 20 SAY PROMPT "TMyBox: Styled containers with colored title bars" ;
    SIZE 1100 COLOR nRGB( 117, 117, 117 ) TO oWnd

@ 610, 20 SAY PROMPT "TMyTitle: Gradient title bars with optional glass effects" ;
    SIZE 1100 COLOR nRGB( 117, 117, 117 ) TO oWnd

  // Activate window
ACTIVATE WINDOW oWnd

RETURN NIL

// EOF

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Mon Jan 19, 2026 01:05 PM

Still working in the syntax,,,, we will convert to #xcommands soon...
No AI needed to create real apps, but an AI can build any app you want with our AI WebX Syntax Guide...
the AI can write the software or modify it for you, and you still will be able to understand it and modify it by hand...

/*
 * WebX POS Integrated Demo
 *
 * Layout Structure:
 * +======================================================+
 * |                   TITLE BAR (60px) [R]               |
 * +========================+=====================+========+
 * |    CATEGORIES (auto)[R]|                     |        |
 * +------------------------+   SHOPPING CART     |  POS   |
 * |                        |      (flex)         | ACTIONS|
 * |       PRODUCTS         |     280px [R]       |  80px  |
 * |        (flex)          |=====================|        |
 * |                        |  KEYPAD (280px) [R] |        |
 * +========================+=====================+========+
 *
 * [R] = Resizable panel (drag the divider line to resize)
 * === = Resizable divider (3D sunken line, highlights blue on hover)
 *
 * Data: Auto-loaded from DBF (categories.dbf, products.dbf)
 *       Database managed by admin panel
 *
 *==========================================================================
 * AJAX BRIDGE - Harbour-Style Server Calls (NEW!)
 *==========================================================================
 * Write your functions in THIS FILE - just like Harbour desktop apps!
 * Use WEBX_CALL() to call them from buttons. WebX handles the AJAX.
 *
 * STEP 1: Define your function (anywhere in this file):
 *   FUNCTION ProcessPayment( cMethod )
 *      // Your code here - runs on server
 *      RETURN "Payment processed: " + cMethod
 *
 * STEP 2: Call it from a button using WEBX_CALL():
 *   oActionButtons:AddButton("CASH", "ICON_MONEY", RGBA(16,185,129,1.0), ;
 *                            WEBX_CALL("ProcessPayment", "cash") )
 *
 * That's it! Just like calling a function in Harbour.
 * The result is shown to the user automatically.
 *==========================================================================
 */

#include "WebX.ch"

FUNCTION Main()
   LOCAL oWnd, oMainLayout, oContentLayout, oLeftLayout, oRightLayout, oRightInnerLayout
   LOCAL oTitle, oCategories, oProducts, oCart, oKeypad, oActions
   LOCAL oCatGrid, oProdGrid, oCartWidget, oNumPad, oTitleBar, oActionButtons

   // Set designed resolution
   PUBLIC Designed_Resolution := {1366, 768, .T.}

   // Define window
   DEFINE WINDOW oWnd TITLE "MayaPOS Premium - Integrated Demo"
   oWnd:lShowThemeWidget := .F.
   // 4px padding all sides, with container sized 8px smaller to stay centered
   oWnd:xContentPadding := 4

   //==========================================================================
   // MAIN LAYOUT: Title (60px, resizable) + Content (flex)
   //==========================================================================
   // Size reduced by 8px (4px padding each side) to stay centered
   oMainLayout := TLayout():New(oWnd, 0, 0, 1358, 760, "ROW")
   oMainLayout:AddRow("title", 60)    // Resizable by default (non-flex panel)
   oMainLayout:AddRow("content", 0)   // Flex panel - not resizable

   //==========================================================================
   // TITLE SECTION
   //==========================================================================
   oTitle := oMainLayout:GetSection("title")
   oTitle:cBackground := GRADIENT(BLUE_DARK)
   oTitle:xPadding := {15, 20, 15, 20}
   oTitle:cShadow := SHADOW(MEDIUM)

   oTitleBar := TPOSTitleBar():New(0, 0, oTitle)
   oTitleBar:cTitle := "MayaPOS Premium"
   oTitleBar:cSubtitle := "Point of Sale Terminal"
   oTitleBar:SetUser("Admin", "Manager")

   //==========================================================================
   // CONTENT: Left (flex) + Right (400px = 280 cart/keypad + 120 actions)
   //==========================================================================
   // Add 8px black border on left and bottom of content area
   oMainLayout:GetSection("content"):aBorderLeft := {8, RGBA(BLACK_PURE)}
   oMainLayout:GetSection("content"):aBorderBottom := {8, RGBA(BLACK_PURE)}

   oContentLayout := TLayout():New(oMainLayout:GetSection("content"), 0, 0, 0, 0, "COLUMN")
   oContentLayout:AddColumn("left", 0)
   // Right panel: 360px default (280+80), min 280px, max 30% of parent
   oContentLayout:AddColumn("right", 400, .F., "LEFT", "START", .T., 240, "30%")

   //==========================================================================
   // LEFT PANEL: Categories (auto, resizable) + Products (flex)
   //==========================================================================
   oLeftLayout := TLayout():New(oContentLayout:GetSection("left"), 0, 0, 0, 0, "ROW")
   oLeftLayout:AddRow("categories", -1)    // Auto-height, resizable by default
   oLeftLayout:AddRow("products", 0)       // Flex panel - not resizable

   // Categories section
   oCategories := oLeftLayout:GetSection("categories")
   oCategories:cBackground := RGBA(248, 250, 252, 1.0)
   oCategories:aBorder := {1, RGBA(226, 232, 240, 1.0), "solid"}
   oCategories:xPadding := 10
   oCategories:cShadow := SHADOW(SMALL)
   oCategories:nMinHeight := 80

   // Category grid (auto-loads from categories.dbf)
   oCatGrid := TPOSCategoryGrid():New(0, 0, NIL, NIL, NIL, oCategories, 6)

   // Products section
   oProducts := oLeftLayout:GetSection("products")
   oProducts:cBackground := RGBA(241, 245, 249, 1.0)
   oProducts:xPadding := 15

   // Product grid (auto-loads from products.dbf)
   oProdGrid := TPOSProductGrid():New(0, 0, NIL, NIL, NIL, oProducts, 5)
   oProdGrid:lShowStock := .T.
   oProdGrid:nLowStock := 5

   //==========================================================================
   // RIGHT PANEL: Cart/Keypad column (flex) + Actions column (80px)
   //==========================================================================
   oRightLayout := TLayout():New(oContentLayout:GetSection("right"), 0, 0, 0, 0, "COLUMN")
   oRightLayout:AddColumn("cartKeypad", 0)     // Flex - cart + keypad stacked
   oRightLayout:AddColumn("actions", 120, .F., "LEFT", "START", .F.)  // 120px, not resizable

   //==========================================================================
   // CART + KEYPAD INNER LAYOUT (stacked vertically)
   //==========================================================================
   oRightInnerLayout := TLayout():New(oRightLayout:GetSection("cartKeypad"), 0, 0, 0, 0, "ROW")
   oRightInnerLayout:AddRow("cart", 0)         // Flex - fills available space
   oRightInnerLayout:AddRow("keypad", 280)     // Fixed 280px

   // Cart section - clean white with DOS-style items list
   oCart := oRightInnerLayout:GetSection("cart")
   oCart:cBackground := RGBA(255, 255, 255, 0.98)
   oCart:aBorder := {1, RGBA(226, 232, 240, 1.0), "solid"}
   oCart:xPadding := 4
   oCart:cShadow := SHADOW(MEDIUM)

   // Cart widget
   oCartWidget := TPOSCart():New(0, 0, NIL, NIL, oCart)
   oCartWidget:lShowTax := .T.
   oCartWidget:lShowRemove := .T.

   // Keypad section
   oKeypad := oRightInnerLayout:GetSection("keypad")
   oKeypad:cBackground := GRADIENT(SLATE_DARK)
   oKeypad:xPadding := {8, 25, 8, 25}
   oKeypad:cShadow := SHADOW(LARGE)

   // Numeric keypad
   oNumPad := TPOSNumPad():New(0, 0, oKeypad, "posKeypadDisplay")
   oNumPad:cColorScheme := "slate"
   oNumPad:cTextSize := "xl"

   //==========================================================================
   // ACTIONS COLUMN (80px) - POS Action Buttons
   //==========================================================================
   oActions := oRightLayout:GetSection("actions")
   oActions:cBackground := GRADIENT(SLATE)
   oActions:xPadding := 8
   oActions:cShadow := SHADOW(MEDIUM)

   // POS Action buttons - user defines their own buttons and actions
   // Similar to TRibbonBar: create control, then add buttons
   oActionButtons := TPOSActionButtons():New(0, 0, oActions)

   //==========================================================================
   // FIVEWIN-STYLE BUTTON ACTIONS using WEBX_CALL()
   //==========================================================================
   // AddButton( cLabel, cIcon, nClrBack, xAction )
   //
   // xAction can be:
   //   1. JavaScript string: "posAction('cash')"
   //   2. WEBX_CALL(): WEBX_CALL("ProcessPayment", "cash")
   //
   // WEBX_CALL() calls YOUR function (defined below) on the server.
   // Just like calling a function in FiveWin!
   //==========================================================================

   // Using string constant names - WebX runtime resolves them automatically
   oActionButtons:AddButton("CASH",   "ICON_MONEY",    "GREEN_SUCCESS", WEBX_CALL("ProcessPayment", "cash"))
   oActionButtons:AddButton("CARD",   "ICON_CARD",     "BLUE_LIGHT",    WEBX_CALL("ProcessPayment", "card"))
   oActionButtons:AddButton("SPLIT",  "ICON_SCISSORS", "PURPLE",        WEBX_CALL("SplitPayment", NIL))
   oActionButtons:AddButton("DISC",   "ICON_TAG",      "YELLOW_WARNING",WEBX_CALL("ApplyDiscount", 10))
   oActionButtons:AddButton("HOLD",   "ICON_PAUSE",    "SLATE_LIGHT",   WEBX_CALL("HoldTransaction", NIL))
   oActionButtons:AddButton("VOID",   "ICON_NO_ENTRY", "RED_DANGER",    WEBX_CALL("VoidLastItem", NIL))
   oActionButtons:AddButton("CANCEL", "ICON_X_MARK",   "RED_ROSE",      WEBX_CALL("CancelTransaction", NIL))

   ACTIVATE WINDOW oWnd

RETURN NIL

//==========================================================================
// SERVER-SIDE FUNCTIONS - Called by WEBX_CALL() from buttons
//==========================================================================
// These functions run on the server when the user clicks a button.
// They receive parameters from the button and return a result.
// The result is automatically displayed to the user.
//==========================================================================

FUNCTION ProcessPayment( cMethod )
   LOCAL cResult := ""
   LOCAL nTotal := 0

   // In a real app, you would:
   // 1. Get the cart total from session
   // 2. Process the payment via gateway
   // 3. Record the transaction in database
   // 4. Clear the cart

   // For demo, just return a message
   IF cMethod == "cash"
      cResult := "Cash payment received. Thank you!"
   ELSEIF cMethod == "card"
      cResult := "Processing card payment..."
   ELSE
      cResult := "Payment method: " + cMethod
   ENDIF

RETURN cResult

FUNCTION SplitPayment()
   // Split payment between multiple methods
RETURN "Split payment mode activated. Enter first payment amount."

FUNCTION ApplyDiscount( nPercent )
   LOCAL cResult := ""

   DEFAULT nPercent := 10

   // Apply discount to cart total
   cResult := "Discount of " + AllTrim(Str(nPercent)) + "% applied!"

RETURN cResult

FUNCTION HoldTransaction()
   // Hold current transaction for later
   // Save cart to database/session with hold status
RETURN "Transaction held. You can recall it later."

FUNCTION VoidLastItem()
   // Remove the last item from cart
   // In a real app, would modify the cart session
RETURN "Last item voided from cart."

FUNCTION CancelTransaction()
   // Cancel entire transaction
   // Clear the cart session
RETURN "Transaction cancelled. Cart cleared."

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: WebX from xBasePHP
Posted: Mon Jan 19, 2026 04:47 PM

Hello Bayron, I really like the screen design of your POS. Could you briefly explain how calls made via WEBX_CALL() are handled technically (HTTP vs. WebSocket), and how this model differs conceptually from a classic microservice or from HIX? Best regards, Otto

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Mon Jan 19, 2026 09:13 PM
Otto wrote:

Hello Bayron,
I really like the screen design of your POS.
Could you briefly explain how calls made via WEBX_CALL() are handled technically (HTTP vs. WebSocket), and how this model differs conceptually from a classic microservice or from HIX?
Best regards,
Otto

First, the entire code is translated to pure PHP, so that function is just an Ajax Call, handled by the framework... you write in xBase, but the transtator converts to PHP, JS, AJAX, JSON, HTLML, CSS or what ever it needs to... the idea is that the regular fivewiner or Harbour user do not need to know all of that,,, just xBase... we handle the Frameworks....

Button Click → JavaScript webxCall() → AJAX POST → PHP WEBX_HANDLE_AJAX()
→ Your xBase Function → JSON Response → JavaScript alert/callback

Just like any ajax call is made, nothing out of the ordinary... so in your desktop you will have harbour, your prg files, and our translator.... you will only upload: PHP, CSS, and JS, everything provided by the translator...

AJAX and Web Sockets are ultimately different technologies, but can both be used to achieve high level performance,,, Web Sockets can be persistent and AJAX performs CRUD operations mostly...

PHP does handles Web Sockets, but Java Script is better for that... Eventually we will get to that...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Mon Jan 19, 2026 09:34 PM

WEBX_CALL() AJAX Bridge:

  • Harbour-style syntax: WEBX_CALL("FunctionName", params)
  • Generates JavaScript that sends AJAX POST request
  • Server intercepts ?_webx_action=FunctionName
  • Calls user's xBase function and returns JSON response
  • No JavaScript knowledge required for developers

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: WebX from xBasePHP
Posted: Mon Jan 19, 2026 10:10 PM

Does WebX use a Harbour WebSocket server to handle WEBX_CALL() and return JSON responses?

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Tue Jan 20, 2026 12:18 AM

No it doesn't... WebXPHP is pure PHP,,, It translates the .prg files to .PHP, then translates the WebX enviroment into PHP and adds a series of helpers for situations as the AJAX handling... the Idea behind WebXPHP is that you won't need a server, a regular Web Site Hosting will be more than enough, and you can run in localhost as well, or use the other WebX products to complement... WebXCGI, WebXfCGI, mod_WebX and WebXServer.

All of them will translate 80% of existing FiveWin code already existing (You will need your current FiveWin License) ,,,, except Windows API, and other Desktop exclusive functions.... so your existing business apps, will already just translate to PHP... or will be ease to migrate... for Alaska XBase++ (You will need your current Alaska XBase++ License) that will be a 70%, except compiled forms and templates and windows API, and other Desktop exclusive functions as well, and Visual Fox Pro, we can translate 80%, and we can even recover compiled forms and templates, and recover source code lost, if you have your compiled .app files... We have a some compatibility with Xalier, MiniGUI, ooHG, as well

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: WebX from xBasePHP
Posted: Tue Jan 20, 2026 12:39 AM

Would it be accurate to describe WebXPHP as a preprocessor with predefined translation rules for FiveWin and other supported languages, while Harbourino follows a more open approach where the user defines the transformation rules as required?

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Tue Jan 20, 2026 01:11 AM

Not exactly,,, xBase to PHP is not as trivial as creating a .ch file....

the entire code has to be Parsed to obtain every single detail, function name, parameters, then break the parameters to see what kind of data, then solve the operations they involve, especially with code blocks and loops...

PHP structures are not the same as xBase... so a JSON structure is made, then analyzed, data evaluated and catalogued to types, string, function name, class name, method name, object, numeric, operators, persistent to stateless conversion, etc..

Then you have Harbour beautiful permissiveness... variables without declarations, operators doing opposite functions depending on environment, trunked function names, Upper and lower cases, functions with the same name in PHP but different results, etc... this is just the tip of the iceberg.....

So no, is not a preprocessor nor a translator, its more like a Decipherer... Deciphers from Ancient Egyptian to English,,,, it doesn't just translates from Spanish to English... In other words, I must do everything Harbour does, but without having harbour.....

I did took the HIX approach first,,, very powerful,,, very useful for me... but I moved to Fivewin because of the syntax, so i refused to let it die... so I took the long road... the one that made Gemini 2.5 commit suicide, that broke Claude 3.5, that Grok and Qwen can't even handle, that has Antigravity and Gemini 3.0 broken right now...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: WebX from xBasePHP
Posted: Tue Jan 20, 2026 07:40 AM

Hello Bayron, From an outside perspective, this initially looked almost like a WebView to me. But I see now it is much more. Am I right in understanding that this approach goes much further, and that it is actually possible to transcribe one’s own existing FiveWin/xBase code into this model, rather than being limited to predefined classes? And once the PHP code is generated, can it then be manually reviewed, extended, or adapted as regular PHP source code?

Best regards, Otto

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Tue Jan 20, 2026 11:15 AM

That is something else we added, code protection,,,, the code already comes out kind of obfuscated... no need for pure code, since the source code is in your hands... .prg

if (is_object($object) && isset($object->className)) {
    $class_name = strtoupper($object->className);
    $method_func = $class_name . '_' . strtoupper($method);
    if (function_exists($method_func)) {
        $stack[] = $method_func($object, $value);
        $method_called = true;
    }
}

we do inject the raw text in there, and that can be modified, but the business logic of the app, cant be stolen, of course an AI could, i guess, break even a real obfuscation... but for an entire app... it will be a hard job still... and we may add obfuscation later if we decide to... very easy to do...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Fri Feb 06, 2026 03:37 AM
Otto wrote:

Hello Bayron,
From an outside perspective, this initially looked almost like a WebView to me. But I see now it is much more.
Am I right in understanding that this approach goes much further, and that it is actually possible to transcribe one’s own existing FiveWin/xBase code into this model, rather than being limited to predefined classes?
And once the PHP code is generated, can it then be manually reviewed, extended, or adapted as regular PHP source code?

Best regards,
Otto

This is a more easier to understand description: so Yes, the idea is to have some code, you can compile to .exe or transpile to .php, and it will run in both frameworks... that is why is taking so long....

https://github.com/mayapos/MayaPOS/blob/main/docs/SBOM.md

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: WebX from xBasePHP
Posted: Fri Feb 06, 2026 08:48 AM

Respect! Impressive!
Hi Bayron,

I shared a link in my Facebook group “Harbour 2 PHP – DevTalks & AI” and added a short technical FAQ to better understand a few aspects for myself.
https://www.facebook.com/groups/863412360879659/

Would you mind taking a quick look and letting me know whether this technical classification looks correct from your point of view?

In the forum, I also cautiously suggested whether a neutral area for general web-related topics in a FiveWin/Harbour context could make sense (HTML, JS, PHP, architectural questions).
If you share this view, I would really appreciate it if you could support this posting towards Antonio.
https://forums.fivetechsupport.com/viewtopic.php?p=283697#p283697

Below is the FAQ I’m referring to:


---

FAQ – xBase → PHP Transpilation, WebXPHP and DBF/CDX Access

This FAQ tries to answer some common questions around xBase-to-PHP migration, WebXPHP, and DBF/CDX access in a factual and neutral way.


---

âť“ Does WebXPHP generate real PHP code or just wrappers?

Yes.
WebXPHP generates real, executable PHP code via source-to-source transpilation.

  • .prg files are translated into PHP
  • no interpreter, no eval()
  • Opcache-compatible
  • the generated code is fundamentally standalone and runnable

Important: the code is generated, not hand-written, and remains logically structured around xBase concepts.


---

âť“ Can you transpile once from PRG to PHP and then continue only with PHP?

Technically yes, practically with limitations.

  • the generated PHP code can be used permanently
  • re-transpiling will overwrite changes
  • the code is not “idiomatic” PHP
  • further development in PHP is possible, but not the primary use case

WebXPHP is mainly intended as a migration target, not as a PHP starting point.


---

âť“ How does DBF access work in WebXPHP?

DBF access is implemented inside the framework.

  • built-in DBF engines (DBFNTX, DBFCDX, DBFNSX)
  • xBase-compatible API (USE, SEEK, SKIP, REPLACE, …)
  • no SQL, no PDO required

The developer continues to work in xBase semantics.


---

âť“ Is CDX support implemented directly in PHP?

In most cases, no.

  • CDX logic very likely originates from Harbour C code
  • PHP is the target language, not a standalone CDX parser
  • CDX support is not available as a separate PHP library

This is integrated index support, not a modular CDX project.


---

âť“ Can the CDX code from WebX be reused in custom projects?

Realistically, no.

  • tightly coupled to the WebX DBF layer
  • not modular or separately documented
  • license-sensitive

WebX is a closed, integrated system, not a code toolkit.


---

❓ WebXPHP or a custom PHP–DBF solution – which makes more sense?

That depends on the goal.

WebXPHP, if:

  • existing xBase code should continue with minimal changes
  • fast web migration is the priority
  • DBF/CDX should “just work”

Custom PHP solutions, if:

  • maximum control over files, locking, and logging is required
  • DBF is only one part of a larger architecture
  • custom index or WAL concepts are planned

Difference: framework migration vs. architectural redesign.


---

âť“ Do we still need to reimplement CDX today?

Not necessarily.

Often more practical:

  • read-only CDX support
  • custom sidecar indexes (JSON, SQLite, etc.)
  • gradual migration away from legacy indexes

---

âť“ Is WebXPHP a compiler or a framework?

Both.

  • Transpiler: PRG → PHP
  • Framework: UI, DBF, session, security, runtime

This dual role makes it powerful — and at the same time more complex to classify.


---

Conclusion

WebXPHP is technically solid, generates real PHP code, and clearly lowers the barrier for migration.
At the same time, it remains a framework-based approach — not a replacement for individual architectures, but an interesting bridge between worlds.

Using the numbers you mentioned — roughly 50,000 FiveWin applications, about 1,000,000 Visual FoxPro applications, around 10,000 xBase++ enterprise systems, and an additional 100,000 Clipper/dBase solutions — it becomes obvious how large this field really is.

This is not a crowded market, but a classic Blue Ocean: a huge existing base, real demand, and very few comparable, universal migration solutions.

Technically, much seems to be in place.
Now it is mainly about visibility, language, and reaching people where they are already looking.

Or, as one might say before a good meal:
the table is set, the food is ready — now it’s time to invite the guests.

Best regards,
Otto

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: WebX from xBasePHP
Posted: Fri Feb 06, 2026 05:59 PM

Hi Otto,

Thank you for taking the time to write such a comprehensive FAQ! Your technical analysis shows real understanding of the problem space. Let me provide some clarifications and expand on a few points.

On DBF/CDX Access - We're Already There:

Your FAQ mentions DBF access as "built-in DBF engines" - this is correct, but let me give you the full picture. WebX includes a complete TDatabase/TRecordSet ORM layer that provides:

// SQL Databases (MySQL, PostgreSQL, SQLite, ODBC)
oDb := TDatabase():New("MYSQL", "localhost", "mydb", "user", "pass")
oRs := oDb:Query("SELECT * FROM customers WHERE active = 1")
DO WHILE !oRs:Eof()
   ? oRs:FieldGet("customer_name")
   oRs:Skip()
ENDDO

/

/ DBF with CDX indexes - NATIVE SUPPORT
oDb := TDatabase():New("DBF")
oDb:Open("customers.dbf")
// Or traditional xBase syntax - it just works:
USE customers INDEX custidx
SEEK "12345"
SKIP
REPLACE name WITH "New Name"
DBCOMMIT()

The CDX/NTX/NSX index support comes from Harbour's battle-tested DBFCDX RDD (Replaceable Database Driver), which is compiled C code - not PHP reimplementation. This means production-grade index handling with proper B-tree operations, multi-user locking, and memo field support.

On "Transpiler or Framework" - It's Actually Three Things:

Transpiler: PRG → PHP (WebXPHP)
PRG → direct execution (mod_webx.so)
Framework: 100+ UI classes (TWindow, TButton, TXBrowse, TChart, TPOSNumPad, TLayout...)

Compatibility Layers: FiveWin API, Alaska xBase++ API, Visual FoxPRO, Clipper, Xailer, HIX, xHarbour extensions
We have a complete Alaska xBase++ compatibility layer that maps their coordinate system and event model (AppEvent/PostAppEvent) to our AJAX bridge, and their controls (XbpDialog, XbpBrowse, XbpSLE, XbpComboBox, XbpMenu...) to WebX equivalents.

Visual FoxPRO, we can decompile their source code back to .prg in the event the source was lost. we can use compiled printing forms and templates.

We can extract resources from .exe and .res files on transpilation from our own created code...

On the Market Analysis:

Your numbers are conservative. Let me add context:

Platform Est. Apps Typical Profile
FiveWin 10,000+ SMB accounting, POS, inventory
Visual FoxPro 1,000,000+ Enterprise LOB, government systems
xBase++ 10,000+ German/European enterprise
Clipper/dBase 100,000+ Legacy systems still running
xHarbour 20,000+ Updated Clipper replacements

Xailer 5,000+ Spanish market
That's potentially 1.2 million applications with developers who know xBase syntax but have no web migration path. Most "solutions" require complete rewrites. WebX lets them keep their code.

The Real Differentiator:

// This FiveWin desktop code...
DEFINE WINDOW oWnd TITLE "My App"
@ 10,10 BUTTON "Save" ACTION SaveData()
@ 10,100 GET cName
ACTIVATE WINDOW oWnd

// ...runs on the web with ZERO changes.
// Same source file. Same syntax. HTML5 output.
No other solution does this. Period.

On the Forum Suggestion:

A neutral area for web-related xBase topics makes sense. The community is fragmented - FiveWin forums, Harbour mailing lists, xBase++ forums - but we're all solving similar problems. I'll take a look at the thread.

Your "table is set" metaphor is apt. The technology works. Now it's about reaching the developers who need it.

Best regards,
Bayron

P.S. - The transpiler also includes an Analyzer that we built, and can debug transpilation issues in 50ms instead of days. This for sure isn't a hobby project.

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: WebX from xBasePHP
Posted: Sat Feb 07, 2026 08:30 AM

Hello Bayron, first of all, thank you again for the additional insights and clarifications — they are genuinely impressive.

“It’s almost ironic that WebXPHP is becoming truly available just now — exactly when I’ve finished learning HTML, JavaScript, and PHP. But that timing is precisely what makes the difference.”

Why?

No lock-in. I can now consciously decide when to use xBase/DBF — and when to rely on modern web tools. A transpiler would have introduced a dependency. Now I choose the tool, not the other way around.

Future over nostalgia. Frameworks come and go. Tools rise and fall. HTML, JavaScript, and PHP remain. The time I invested wasn’t about solving today’s problem faster — it was about long-term flexibility.

Architectural control. Instead of generated code that “somehow works,” I now build systems I fully understand, can explain to others, and can adapt without fear. Transparency beats magic every time.

Hybrid strength. I can combine the best of both worlds: using DBF data selectively inside web applications — without relying on a black box or a forced framework.

Yes, it was more work. But it was the right work — for projects meant to live longer than a quick migration tool.

If anyone finds themselves in a similar position: I’m happy to share how I integrate DBF into PHP projects — without framework lock-in. Just send me a private message.

Best regards, Otto