Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
X# examples - Hello world
Message
From
10/10/2019 08:18:45
 
 
To
10/10/2019 03:00:12
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01671443
Message ID:
01671444
Views:
160
Visual FreePro syntax:

>// GUI Hello world
>USING System.Windows.Forms // We don't want to type the whole namespace everytime...
>FUNCTION Start() AS VOID
> LOCAL cTxt, cTitle := "My hello world GUI app" [AS STRING] // Optional "AS Type" declaration for strict typing, and inline assignment during declaration.
> cTxt := "Hello world" // Note X# in all languages except VFP syntax use ":=" for assignment and "=" or "==" for comparison
> MessageBox.Show(cTxt, cTitle) // Because we USING System.Windows.Forms we don't have to provide the namespace here of MessageBox
>RETURN
* Visual FreePro, Jr. example (VJr)
FUNCTION Start
LOBJECT parms  && Can also use LPARAMETERS or () syntax
RETURNS void
LOCAL lcTxt, lcTitle

    lcTitle = "My hello world GUI app"
    lcTxt   = "Hello world"

    MESSAGEBOX(lcTxt, lcTitle)

    && Implied return if end of function
Visual FreePro, Jr. is designed to be nearly 100% compatible with VFP9, with several added extensions. Visual FreePro (the full version) is designed to be about 80% compatible, and introduces a slightly different syntax:
// Visual FreePro (full version) example (VFrP)
function Start
| params // ... as needed
| returns
{
    // Variables defined here are implied local.  You must use 'public' or private to declare otherwise
    lcTitle = "My hello world GUI app"
    lcTxt   = "Hello world"

    messagebox(lcTxt, lcTitle)
}
Both VJr and VFrP have a traditional object model, with several extensions. Empties are more flexible. And everything can be expanded with new PEMs, not just container objects.

It was a good design. A good vision. A good goal. It's a shame nobody came on board to help me complete it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform