Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making PHDBase work under ExecScript()
Message
 
 
À
09/07/2007 21:54:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01238479
Message ID:
01238765
Vues:
19
>>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')
* Get the whandle for the current window
lnHandle = _WonTop()
lnResult = _EdGetEnv( lnHandle, @laEnv )
* [ 17 ] SelStart
* [ 18 ] SelEnd
* [ 25 ] Editor Session:  0 - Command Window

IF ( lnResult = 0 ) OR ( laEnv[17] = 0 ) OR ( laEnv[25] <> 0 )
  _CLIPTEXT = ""
  RETURN
ENDIF

* Get the current cursor position
lnSelStart = laEnv[17] 
lnSelEnd = laEnv[18] 
* Store result into clipboard
_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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform