>>1. Have you verified that you can run the script from VFP using Execscript? If the first step fails, then you would not be able to proceed any futher.
>
>Yes, this works from VFP.
>
>I have found that SET("LIBRARY") does not work with ExecScript(). But, SET("PATH") works. This seems to indicate that the use of a library in that environment is not supported. It still suprises me that no error is reported with the SET LIBRARY TO PHDBASE command. Having the library not loaded would then explain why any call to PHD() would generate an error.
>
>The only other alternative I could think would be to issue a shell VFP command with a PRG file from within .NET. But, that would mean that I would need VFP install.
I was just preparing to try some code using set library within execscript. I'll report back.
Ok, SET LIBRARY worked in my test inside exescript within VFP.
Here is my test:
Program testff
LOCAL ARRAY laEnv [25]
SET LIBRARY TO HOME() + 'FoxTools' ADDITIVE
STRTOFILE(SET("Library"),HOME() + 'SetLib.txt')
lnHandle = _WonTop()
lnResult = _EdGetEnv( lnHandle, @laEnv )
IF ( lnResult = 0 ) OR ( laEnv[17] = 0 ) OR ( laEnv[25] <> 0 )
_CLIPTEXT = ""
RETURN
ENDIF
lnSelStart = laEnv[17]
lnSelEnd = laEnv[18]
_CLIPTEXT = _EdGetStr( lnHandle, lnSelStart, lnSelEnd )
and ON KEY LABEL F5 execscript(filetostr('testff.prg'))
I select some code in the command window and press F5 and everything works.
Something else is wrong.
If it's not broken, fix it until it is.
My Blog