Solved

Programming code with runtime form

Posted on 2014-01-22
4
607 Views
Last Modified: 2014-01-22
Hi, looking a way to program "external executable" subroutine (PRG) within a runtime form.  Basically, my application is self-contained and I recently added "customs" programming to satisfy some customer specific requirements without having to modify core application.  So, I'm looking to create a form with some selection tools to allow authorized user to see and modify external PRG code.  User can copy code from one PRG, add it to another PRG and then save this "new work".  
Is this something that can be done under VFP 9
0
Comment
Question by:meep_meep
  • 2
  • 2
4 Comments
 
LVL 41

Expert Comment

by:pcelba
ID: 39800095
This is very easy:
1) To modify PRG code issue MODIFY COMMAND <filename>
2) To compile the modified code issue COMPILE <filename>

Above commands work even under VFP 9 run-time so you may place then almost anywhere.

If the Edit menu is visible the CTRL+C and CTRL+V etc. shortcuts are active.

MODIFY COMMAND has several useful clauses like NOEDIT which allows just viewing of the source code so this can be used to copy the existing fragments of code.

COMPILE produces <filename>.ERR if compile error occurs.

WARNING: Remember the fact users can harm app data this way...
0
 

Author Comment

by:meep_meep
ID: 39800160
So, I can issue a Modify Command within a runtime Form ?   To be more specific, my form will have a list of customer specific external prg.   On InteractiveChange event, I will be able to show within an "Edit box like" the specified PRG in my form ?
0
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 39800184
Yes. The Edit box should be bound (via ControlSource property) to some memo field and the interactive event may read the memo contents by APPEND MEMO FROM <YourFile>.PRG command then user may edit the code and save it back to PRG or keep it in the memo field.

EXECSCRIPT command allows to execute the code inside the memo.

Of course you don't need to use memo field but the whole thing may be in some variable or in a form property.  You may read the PRG file into the variable by FILETOSTR() function call in InteractiveChange event. Reading the local file this way is very fast.
0
 

Author Closing Comment

by:meep_meep
ID: 39800762
As usual, you're quick and efficient. Thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Insert into Excel a sum for three columns 8 604
Alter Cursor Results 4 126
Mysql Search for contact 6 232
VFP9 SQL Union and Group by 5 207
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now