fbpx
Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro

TOPIC: Foxpro compatibility list

Foxpro compatibility list 15 Oct 2019 16:38 #11196

  • robert's Avatar

  • robert

  • Topic Author


  • Posts: 1748
  • Some people have asked for a list of (Visual) FoxPro commands and how they are supported in X#.
    I have just added a list to the Help - FAQ menu on this website:
    www.xsharp.info/itm-help/foxpro-compatibility-list
    This list reflects the status of build 2.08 that will be released this week.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 01:21 #11205

  • FoxProMatt's Avatar

  • FoxProMatt


  • Posts: 391
  • Robert - Thank you for posting this, as promised.

    It will be fun to watch the NOT ones fall away in the coming months.

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 01:32 #11206

  • FoxProMatt's Avatar

  • FoxProMatt


  • Posts: 391
  • Robert - what does it mean that commands like BROWSE or DO FORM are marked as “n/a” ??

    These are very common FoxPro things to do, even at runtime, so what does it mean n/a instead of “NOT Supported (at this time)”? There will be lots of these particular commands in transported code that will have be dealt with.

    Does it mean “this feature will NOT be supported (ever) in X#, so get ready to change any code that you have like this”?

    Please Log in or Create an account to join the conversation.

    Last edit: by FoxProMatt.

    Foxpro compatibility list 16 Oct 2019 08:34 #11208

  • robert's Avatar

  • robert

  • Topic Author


  • Posts: 1748
  • Matt,

    with n/a I meant "not applicable". These are commands that are part of the VFP IDE afaik, or is EDIT, BROWSE etc also used in production code ?. In that case I'll change them to not supported

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 08:51 #11211

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2281
  • Hi Robert,

    PMFJI: I have not seen much VFP code, but these commands are very used (like a DBU that is not only integrated in the IDE, but can also be used in the applications - I have seen users open up a command line in their VFP application and typing "browse xxxx".
    And I have to admit that sometimes I likes to have that also in my own applications... (I have now a similar functionality as I can drop any DBF file on my running VO applications).
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 10:00 #11212

  • alanbourke's Avatar

  • alanbourke


  • Posts: 20
  • BROWSE is indeed handy, although it is kind of intrinsic to the VFP IDE. It's akin to the functionality that Visual Studio has where you can bring up a quick table inspector based on a connection for convenience. But really, has anyone used BROWSE in deployed software since proper grids appeared in the first version of VFP? If they have they shouldn't IMO.

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 10:53 #11213

  • lumberjack's Avatar

  • lumberjack


  • Posts: 686
  • Hi Alan,

    Alan Bourke wrote: BROWSE is indeed handy, although it is kind of intrinsic to the VFP IDE. It's akin to the functionality that Visual Studio has where you can bring up a quick table inspector based on a connection for convenience. But really, has anyone used BROWSE in deployed software since proper grids appeared in the first version of VFP? If they have they shouldn't IMO.

    I also feel it would be quite handy, specially during debug to display data quickly.

    The nice thing is, one can write a function DbBrowser() and map with #command to it.
    #command BROWSE => DbBrowser()
    FUNCTION DbBrowser() AS VOID
      LOCAL oForm AS Form
      LOCAL oGrid AS DataGridView
      LOCAL oDT AS DataTable
      LOCAL row AS DataRow
      LOCAL i AS DWORD
      // Create a table, give it any name you like
      oDT := DataTable{DbAlias()}
      // Make some columns for the table from each column in the DBF
      FOR i := 1 UPTO FCount()
        oDT:Columns:Add( DataColumn{ FIELDNAME(i) } )
      NEXT
      // Now load with data
      DbGotop()
      DO WHILE ! EOF()
        // Create a new row
        row := oDT:NewRow()
        // Put data into the columns in the row
        FOR i := 1 UPTO FCount()
          row[ FIELDNAME(i) ] := AsString(FieldGet(i))
        NEXT
        // Add the row to the table
        oDT:Rows:Add(row)
        // Move to next record
        DbSkip()
      ENDDO
      // Create a form and datagrid to display the DBF
      oForm := Form{}
      oForm:Size := Size{400, 100}
      oForm:Text := "My first BROWSE"
      oGrid := DataGridView{}
      ... // Tie the grid data source to the DataTable
      oGrid:DataSource := oDT
      oGrid:DockStyle := DockStyle.Fill
      oForm:Controls:Add(oGrid)
      oForm:Show()
    RETURN
    Voila, the first version of the BROWSE command is implemented in X#.

    Hope this is of interest to (some) VFPers and (most) X#ers,
    ______________________
    Johan Nel
    George, South Africa

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 15:08 #11218

  • FoxProMatt's Avatar

  • FoxProMatt


  • Posts: 391
  • Yes, expect to see these commands used in running apps. Might seem crude by today’s standards, but it was (still is) a real part of writing VFP apps that shouldn’t be ignored. Absent of supporting these there wouldn’t be as full of VFP support/implementation as could be or even needs to be.

    “Handy” is not the right way to view these. The are actually used in plenty of cases.

    Also, DO FORM, with all it’s supported clauses (WITH and TO), is absolutely required as it is a VERY common way forms are launched and interacted with programmatically. This is certainly in a different category than the older, crude BROWSE command (and its many optional clauses)

    Please Log in or Create an account to join the conversation.

    Last edit: by FoxProMatt.

    Foxpro compatibility list 16 Oct 2019 15:38 #11219

  • alanbourke's Avatar

  • alanbourke


  • Posts: 20
  • How many running apps though? Enough to warrant implementing all this ?
    BROWSE [FIELDS FieldList] [FONT cFontName [, nFontSize [, nFontCharSet]]] 
       [STYLE cFontStyle] [FOR lExpression1 [REST]] [FORMAT] 
       [FREEZE FieldName] [KEY eExpression1 [, eExpression2]] [LAST | NOINIT]
       [LOCK nNumberOfFields] [LPARTITION] [NAME ObjectName] [NOAPPEND]
       [NOCAPTIONS] [NODELETE] [NOEDIT | NOMODIFY] [NOLGRID] [NORGRID] 
       [NOLINK] [NOMENU] [NOOPTIMIZE] [NOREFRESH] [NORMAL] [NOWAIT] 
       [PARTITION nColumnNumber [LEDIT] [REDIT]]
       [PREFERENCE PreferenceName] [SAVE] [TIMEOUT nSeconds] 
       [TITLE cTitleText] [VALID [:F] lExpression2 [ERROR cMessageText]]
       [WHEN lExpression3] [WIDTH nFieldWidth] [WINDOW WindowName1]
       [IN [WINDOW] WindowName2 | IN SCREEN] [COLOR SCHEME nSchemeNumber]
    

    Please Log in or Create an account to join the conversation.

    Last edit: by alanbourke.

    Foxpro compatibility list 16 Oct 2019 15:52 #11220

  • robert's Avatar

  • robert

  • Topic Author


  • Posts: 1748
  • Alan,
    Now all of our source is open, I am sure Matt will write this UDC and the function to implement this :)
    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 17:48 #11224

  • mainhatten's Avatar

  • mainhatten


  • Posts: 139
  • Matt,

    with n/a I meant "not applicable". These are commands that are part of the VFP IDE afaik, or is EDIT, BROWSE etc also used in production code ?. In that case I'll change them to not supported
    [/quote}

    Definately seconding Matt in that it can be used in programs. Alans argument, since grids were introduced, Browse should not be used in programs insofar false, as browse command was enhanced with "Name" clause, allowing programmatic handling via OOP properties. Use cases are getting scarce, the closer you get to shrink-wrapped apps, but in some use cases where either a Excel spreadsheet could be created or table based solution used, slinging together a few Browses are better than normal forms.
    Other use case - similar to using "wait window " against all GUI guidelines is for apps build for limited smart user group on also limited budget ;-)

    regards

    thomas

    Please Log in or Create an account to join the conversation.

    Last edit: by mainhatten.

    Foxpro compatibility list 16 Oct 2019 17:59 #11225

  • mainhatten's Avatar

  • mainhatten


  • Posts: 139
  • Alan Bourke wrote: ...But really, has anyone used BROWSE in deployed software since proper grids appeared in the first version of VFP? If they have they shouldn't IMO.


    "Proper" grids? ;-)
    crea cursor t_t (c1 c(20),c2 c(20),n1 I)
    insert into t_t values ("Browse", "not really magic", 3)
    insert into t_t values ("only dynamic ", "binding of", 2)
    insert into t_t values ("some properties ", "to surrounding containers", 2)
    browse name oBr_T_T partition 100 Redit
    oBr_T_T.Left= 200
    ? oBr_T_T.Class
    Sometimes just a grid is enough for quick peeks - one example before printing oodles, quick-checking the result cursors might be easier than via the print preview.

    Full ACK that it is not the common scenario - but "n/a" would be wrong.

    regards

    thomas

    Please Log in or Create an account to join the conversation.

    Last edit: by mainhatten.

    Foxpro compatibility list 16 Oct 2019 18:07 #11227

  • mainhatten's Avatar

  • mainhatten


  • Posts: 139
  • Robert van der Hulst wrote: This list reflects the status of build 2.08 that will be released this week.


    Robert,
    I think the following should be switched from n/a to unsupported:
    alter table		&& used often in import tasks
    compile			&& multi-line generated code can be executed via execscript AND compile, compile gives benefits
    create from		&& table from struc extended
    create cursor | TABLE	&& used quite often in my code
    create DATABASE		&& in case I need to zip+send DB-enhanced dbf
    create TRIGGER ON	&& most of the time probably better done in DD at design time ;-)
    create CONNECTION	&& clearly debatable
    regards

    thomas

    Please Log in or Create an account to join the conversation.

    Last edit: by mainhatten.

    Foxpro compatibility list 16 Oct 2019 18:48 #11228

  • mainhatten's Avatar

  • mainhatten


  • Posts: 139
  • Robert van der Hulst wrote: Alan,
    Now all of our source is open, I am sure Matt will write this UDC and the function to implement this :)


    Just thinking through the keyboard: As there are already 3 GUI options, I am hoping for Xamarin/Android/Web[/iOS] as targets when vfp works, the old "browse" command, already cryptic,might need different values/parameters for other GUIs IAC.
    I saw in other code samples that {} notation (which is nonexistant in vfp language) is supported. Perhaps translating those few browses used in App code should be transferred to a JSON notation to be Addpropertied to the grid as structure of empty-objects, to be used by a xSharp-function to set correct values, where dynamic setting is overridden.
    Such JSON text could be gotten from inserting a special function in the vfp code to read out the Browse and piped into a text file, including lineno(), correct property names and a definable marker text.

    no idea how much work configuring parsing of "browse" would be - so there would be an alternative.
    There is also the option to persist the grid with all properties in a vcx as a class - take the lines I wrote to Alan and add:
    ? oBr_T_T.SaveAsClass("Testvcx", "BrowseDemo", "for xSharp")

    regards

    thomas

    Please Log in or Create an account to join the conversation.

    Last edit: by mainhatten.

    Foxpro compatibility list 16 Oct 2019 19:17 #11229

  • Kevin Clark's Avatar

  • Kevin Clark


  • Posts: 70
  • Thanks for posting this.

    I did a search in the source code of my main VFP program (about 250K lines) and found BROWSE about 10 times. But those are cases where I really should use a grid; so I'd personally have no problem with BROWSE being deprecated.

    Are all the items in the list which say "not supported" items which you are planning to support?

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 16 Oct 2019 21:07 #11232

  • FoxProMatt's Avatar

  • FoxProMatt


  • Posts: 391
  • Indeed, BROWSE, is an easy one to live without, or adjust for.

    However, DO FORM is a different case, and that one surely cannot be disregarded as easily as BROWSE.

    Here is the full DO FORM syntax from Help:
    .
    DO FORM FormName | ? [NAME VarName [LINKED]] [WITH cParameterList]
    
       [TO VarName] [NOREAD] [NOSHOW]

    Please Log in or Create an account to join the conversation.

    Last edit: by FoxProMatt.

    Foxpro compatibility list 17 Oct 2019 00:50 #11235

  • mainhatten's Avatar

  • mainhatten


  • Posts: 139
  • Matt Slay wrote: Indeed, BROWSE, is an easy one to live without, or adjust for.
    However, DO FORM is a different case, and that one surely cannot be disregarded as easily as BROWSE.
    Here is the full DO FORM syntax from Help:

    DO FORM FormClassName | ? [NAME FormVarName [LINKED]] [WITH cParameterList]
       [TO ReturnVarName] [NOREAD] [NOSHOW]


    Matt,
    Yes and No. The "Do Form" syntax is a holdover from GenScrn handling, where the read loop had to be established under DOS and IIRC was issued in one of the generated subfunctions with sys(2015) function names hard to hook from rest of the program.
    In GUI read loops became very common, but they had added Name [linked] clause in vfp3 similar to browse name to marry new OOP paradigma with the old syntax - IIRC Do Form will be equivalent to
    private | public FormVarName, ReturnVarName 
    FormVarName   = createobject("FormClassName"[,WITH cParameterList])
    [FormVarName.SHOW = .f.]
    [FormVarName.WindowType = 2]   && Uncertain, would have to read docs on where and when to issue READ... 
    && ReturnVarName will be assigned returnvalue of FormVarName.unload()
    My guess is that most code in the wild uses "Do Form", so it should be supported

    Please Log in or Create an account to join the conversation.

    Last edit: by mainhatten.

    Foxpro compatibility list 17 Oct 2019 01:30 #11236

  • mainhatten's Avatar

  • mainhatten


  • Posts: 139
  • Kevin Clark wrote: But those are cases where I really should use a grid; so I'd personally have no problem with BROWSE being deprecated.


    Kevin,
    you are already using a grid - only you did not set all the necessary properties. Having such an option might be useful for checking all kinds of tables on deleted() before packing. As it basicalliy is nothing but a dynamic, uncontained grid, it should be supported - but not with highest priority.

    Johan Nel wrote:

    #command BROWSE => DbBrowser()
    FUNCTION DbBrowser() AS VOID
      LOCAL oForm AS Form
      LOCAL oGrid AS DataGridView
      LOCAL oDT AS DataTable
      LOCAL row AS DataRow
      oDT := DataTable{DbAlias()}
      // Now load with data
      DbGotop()
      DO WHILE ! EOF()
        // Create a new row
        row := oDT:NewRow()
        // Put data into the columns in the row
        FOR i := 1 UPTO FCount()
          row[ FIELDNAME(i) ] := AsString(FieldGet(i))
        NEXT
        // Add the row to the table
        oDT:Rows:Add(row)
        // Move to next record
        DbSkip()
      ENDDO
    Voila, the first version of the BROWSE command is implemented in X#.
    Hope this is of interest to (some) VFPers and (most) X#ers,


    VERY nice for a on-a-moment solution! But as the "smart usage of client disk/resources via local tables/cursors" kept me in vfp for ages when ADO, ADO.NET, Python/Javascript in-memory-cursors returned from their DBAdapters were available in languages sporting nicer other OOP features. I expect (in the end) a solution where skipping in upmost parent of 7 to 12 tables all linked either via "set key" or "set relation" does not cascade into loading/showing 11 such memory tables when on disk everything is already done ;-)

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 17 Oct 2019 15:18 #11248

  • нДраган's Avatar

  • нДраган


  • Posts: 1
  • The browse...name and manipulating the automatic grid that gets created in the background could be something applicable now, with just the same trick applied. Whenever there's a browse command, a grid would be created with some default values and that's it. That's what Fox does anyway. Syntactically, not all the clauses are required - the validation, width, saving the setup in foxuser and several other things were rarely used (I know I used them last in FPD). The ability to select fields, including calculated, and to designate scope (browse ... rest, browse ... key) would really help.

    Please Log in or Create an account to join the conversation.

    Foxpro compatibility list 17 Oct 2019 22:43 #11263

  • lumberjack's Avatar

  • lumberjack


  • Posts: 686
  • Hi Thomas,

    Thomas Ganss wrote: VERY nice for a on-a-moment solution! But as the "smart usage of client disk/resources via local tables/cursors" kept me in vfp for ages when ADO, ADO.NET, Python/Javascript in-memory-cursors returned from their DBAdapters were available in languages sporting nicer other OOP features. I expect (in the end) a solution where skipping in upmost parent of 7 to 12 tables all linked either via "set key" or "set relation" does not cascade into loading/showing 11 such memory tables when on disk everything is already done ;-)

    Well seeing Robert posted a working SCAN command with bells and whistles, I leave it to VFP guys to enhance my BROWSE and DbBrowser function to handle more of the bells and whistles... :P
    ______________________
    Johan Nel
    George, South Africa

    Please Log in or Create an account to join the conversation.