We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

This forum is meant for examples of X# code.

mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by mainhatten »

This is ***not*** something X# specific, but an option to edit, compile & run simple prg based scripts of fox code
It needs the Vfp9SP2 Runtimes from https://github.com/VFPX/VFPRuntimeInstallers or http://www.foxpert.com/download/runtime.html and will give you a command window REPL from which you can issue anything the Runtime supports - which does include compiling prg into fxp and then run those fxp.
So those with none or only older versions of fox/vfp can compile & run
  • own scripts after no or minimal editing under the version of vfp X# will implement
  • check out benchmarking scripts comparing the implementation in X# on your machine
  • follow the discussion and examples between dev team and fox heads by running small examples
  • copy the small tidbits found in fox help file and play with those in fox
  • Try out the benefit of integrated SQL
  • Try out the benefit of the buffering / optimistic locking approach coupled with tableupdate
  • write own or run foreign benchmarks and pipe results into text files to compare to VO or X#
  • call into GUI Class libraries after set classlib or via NewObject()
  • build GUI in prg from scratch / test previously class based and prg-ported GUI
  • connect to several backends via Cursoradapter, View or SQL Pass Through
  • and much more
Original abandoned source is on https://github.com/EdLeafe/vRunFox, a few fixes/deletions to fix build errors. Changed source available for looking/fixing/adding functinality for the price of asking, perhaps I'll put it on Github. Login is "X#" or "x#", has command history showing off a few things.
2 minimal dummy Prg added and compiled, as well as table to play with. Do not play with FoxUser.
Vfp9Sp2 Help File can be loaded: https://github.com/VFPX/HelpFile
with small code samples and explaining some of the concepts I mentioned in the list better than I could.

hope it interests & helps some here
thomas
Attachments
target.zip
(40.83 KiB) Downloaded 191 times
FoxProMatt

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by FoxProMatt »

1. I'll check this out.
2. I really wish you would post it as a repo on Github, rather than attaching it as a zip file in a message board.

#2 allows for public discussion and issue tracking in the GitHub space, rather than tucked away here in an X# message thread. In my opinion, it would be a lot more interest to the general FoxPro community if it we in it's own github repo.
FoxProMatt

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by FoxProMatt »

mainhatten - I sent this link to a VFP friend of mine just now (Jeff Roberts, he's not here on X# board), and he immediately download it to tinker around, and here is his feedback:

Code: Select all

Interesting.... I could be missing something but it asks for a password that I do not know. Scanning through the files in the zip I do not see a password field or clue. I also don't see a PJX/PJT file so think at least some of the source is missing. -Jeff
Any advice for this issue??
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by robert »

Matt,
Thomas wrote:

> Login is "X#" or "x#"

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by mainhatten »

Hi Matt,
FoxProMatt wrote: 1. I'll check this out.
2. I really wish you would post it as a repo on Github, rather than attaching it as a zip file in a message board.

#2 allows for public discussion and issue tracking in the GitHub space, rather than tucked away here in an X# message thread. In my opinion, it would be a lot more interest to the general FoxPro community if it we in it's own github repo.
On 1)
All the better if vfp heads check it out to find areas not well supported - our vfp environment has many more HP, but this here is meant to help those not used to bright side of vfp capabilities to expierience them on their own machines.
I already found that I need publics directly in command window - also that one of the special concepts like Datasessions should be better shown, as set window is not available. On the bright side: Already included is the "ArrayBrowser" - as no debugger runs, it gives the option to "watch" vfp arrays as a cursor.
On 2)
Attached was only the exe and some dummy prg and example table of vfp functions. Before going to Github, I'd like to estimate interest first - Zip of Sources can be mailed or attached at other post. If there is no interest at all, why put it up on Git ? Ed's version was targeted to be included in apps - why create a newer version better adapted only to run as standalone, if not even here there is interest ?

Must be true to my Git alias "lazy-fox" ;-)
thomas
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by mainhatten »

FoxProMatt wrote:

Code: Select all

Interesting.... I could be missing something but it asks for a password that I do not know. Scanning through the files in the zip I do not see a password field or clue. I also don't see a PJX/PJT file so think at least some of the source is missing. -Jeff
Any advice for this issue??
As Robert already answered - but perhaps still a chance to mislead or misguide from my side, let me add that Len(pwd)=2... It is not meant as a real deterrent (which was needed if embedded).
Edit: If Jeff is not in this forum, he must have DL Ed's version. Tell him to search for the .H file to find the pwd, which is a bit longer than the stuff I put up....

Currently up no sources, only compiled exe - if Jeff wants the sources, I'll post here or send zip via mail. Git if the VO devs NOT having access to vfp dev system find useful and it gets some traction, see other post.

At least now I can offer "my" implementations of vfp functions in X# to check in X# and vfp now for everybody interested on the machines they are used to or need to run on - might help in other areas as well.

regards
thomas
FoxProMatt

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by FoxProMatt »

mainhatten - I sent Jeff a link to this message on X# board post , so if it's a public board, I assume he was able to download from here, even if he doesn't have a login.

I'll pass along the x# X# password to him.
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by Karl-Heinz »

Hi Thomas,

thanks for the upload. Now i´m able to run Foxpro 2.0 code with VFP :-)

Here´s what i´ve found so far:

- it seems that the "?" output is not redirected to the main screen. I noticed that you are using in your samlpes "wait window" to show results.

Code: Select all

FUNCTION wwp(tcMess)
tcMess = EVL(m.tcMess, "Keine Message mitgegeben")

&& WAIT WINDOW m.tcMess

? m.tcMess  && the output doesn´t become visible ?

RETURN
- when i open or create a prg file via the "modify command" i can edit and save the code via the "File" menu. Somewhat annoying is that an opened editor is always closed as soon as I click on another area than the menu.

- It seems that the menu item states are not always updated. e.g. it´s not possible to compile a prg via the menu item "compile" because the item is always disabled. But that´s no show stopper, because there´s no problem to compile sources inside the command window via the "compile" command.

regards
Karl-Heinz
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by mainhatten »

Karl-Heinz wrote:Hi Thomas,
thanks for the upload. Now i´m able to run Foxpro 2.0 code with VFP :-)
Yupp, thats what I hoped ;-)
Here´s what i´ve found so far:
- it seems that the "?" output is not redirected to the main screen. I noticed that you are using in your samlpes "wait window" to show results.
Weird - should work, as I thought I had fixed it ... see attached jpg, started session under list memory, results of "?" with correct info in white in green screen (coloring left as was in original source code).
Will check uploaded version...
- when i open or create a prg file via the "modify command" i can edit and save the code via the "File" menu. Somewhat annoying is that an opened editor is always closed as soon as I click on another area than the menu.
True. But IMO "Icing on the cake", take ANY editor, edit away, save, compile & run in command window.
Perhaps I'll stumble over something if adding/fixing more pressing errors, of course then I'll correct, but till then,
fire up FP2, set default to the directory vRunfox points to and you are in separate process...
- It seems that the menu item states are not always updated. e.g. it´s not possible to compile a prg via the menu item "compile" because the item is always disabled. But that´s no show stopper, because there´s no problem to compile sources inside the command window via the "compile" command.
I confess, I am not always a "Mausschubser"...
Attachments
vRunfox_Screen.jpg
vRunfox_Screen.jpg (61.97 KiB) Viewed 2008 times
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

We Will Fox You! - Command Window to Compile and Run simple vfp/foxpro scripts

Post by mainhatten »

Karl-Heinz wrote: - it seems that the "?" output is not redirected to the main screen. I noticed that you are using in your samlpes "wait window" to show results.
Downloaded my stuff again, unzipped and ran - works as expected.
_Screen.BackColor is 8421376
_Screen.ForeColor is 16777215
If I set _Screen.ForeColor = RGB(0,0,0)
_Screen.ForeColor is then 0 as expected (Black on green)

You can also play with the settings in the .cfg file, those are used at startup so your last setting should be persisted. Or you could run following code either as prg or in command window

Code: Select all

_Screen.ForeColor = RGB(0,0,0)
? _Screen.ForeColor, "Black as _Screen.ForeColor"
_Screen.BackColor = RGB(255,255,255)
? _Screen.BackColor, "White as _Screen.BackColor"
? _Screen.ForeColor, "Black _Screen.ForeColor"
_Screen.ForeColor = RGB(255,0,0)
? _Screen.ForeColor, "Red as _Screen.ForeColor"
_Screen.ForeColor = RGB(0,255,0)
? _Screen.ForeColor, "Green as _Screen.ForeColor"
_Screen.ForeColor = RGB(0,0,255)
? _Screen.ForeColor, "Blue as _Screen.ForeColor"
_Screen.ForeColor = RGB(0,0,0)
? _Screen.ForeColor, "Black as _Screen.ForeColor"
HTH
thomas .
Post Reply