Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
External Script Access to .APP Forms
Message
 
 
To
21/02/2007 06:32:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01197539
Message ID:
01197564
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
Check if this Re: Best practices using ExecScript() Thread #1105393 Message #1105419 suggestion can help you.

Check also Re: Have I missed something - Thread #1024207 Message #1024605

>I'd like to provide users of my app the ability to execute scripts (in VFP code) from a memo field library table with access to forms compiled in the main application .app file.
>
>The mechanism is in the following code where the memo field script is passed as the tcScript parameter:
>
>FUNCTION ExecCode
>*
>LPARAMETERS tcProgName,tcScript,tdDate,toParms
>*
>LOCAL ;
>	lcRunPath,;
>	lcProgramFile,;
>	lcProgramPrgFile,;
>	lcOldSafety,;
>	luReturn,;
>	lcRun
>*
>*-	.prg names used by ExecCode()
>*-	repolist.cdosname
>*-	csstqury.progname
>*-	scripts.progname
>luReturn = ''
>lcRunPath = FULLPATH(CURDIR())
>lcProgramExeFile = lcRunPath + tcProgName + '.fxp'
>lcProgramPrgFile = lcRunPath + tcProgName + '.prg'
>
>IF NOT EMPTY(tcProgName) AND NOT EMPTY(tcScript) AND NOT EMPTY(tdDate)
>	IF NOT FILE(lcProgramExeFile) OR FDATE(lcProgramExeFile) < tdDate
>		lcOldSafety = SET('SAFETY')
>		SET SAFETY OFF
>		ERASE (lcProgramExeFile)
>		STRTOFILE(tcScript,lcProgramPrgFile)	
>		COMPILE (lcProgramPrgFile)
>		*ERASE (lcProgramPrgFile) && comment this line out for debugging
>		SET SAFETY &lcOldSafety
>	ENDIF
>
>	IF FILE(lcProgramExeFile)
>		*- SET PROCEDURE TO (lcProgramExeFile) ADDITIVE
>		lcRun = tcProgName + '(' + IIF(NOT EMPTY(toParms),'toParms','') + ')'
>		luReturn = &lcRun
>	ENDIF
>ENDIF
>
>RETURN luReturn
>
>
>This does everything I want except give me access from the script to existing forms compiled into the main application .app file in the runtime environment with a DO FORM command in the VFP script. That works in the development environment but not runtime. Is there any way to accompish that?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform