Hi,Everyone
Sometime, I want to automate create some codes in runtime and put them into
a temp file (such as temp.prg),and compile project into a exe file, if
execute such exe file which includes these codes in vfp environment, it
works well. but if I execute such exe file solely, it always comes a error
message indicate that there is a error in line 7. The following is my
example:
&& A edit object is in thisform named edit1
&& A command object is in thisform named cmd1, caption:execute
&& Those codes what I want pc to do is write in edit1 object
In Click event of Cmd1
I put such code in it:
LOCAL TempCurs,tmpDir,RetVal,ErrMessage
TempCurs=SYS(2015)
RetVal=ALLTRIM(ThisForm.Edit1.Value)
STRTOFILE(RetVal,ADDBS(GETENV("Temp"))+TempCurs+'.prg')
TRY
Do (ADDBS(GETENV("Temp"))+TempCurs+'.prg')
CATCH TO ErrMessage
MESSAGEBOX(ErrMessage.Message+"ÔÚ(µÚ"+TRANSFORM(ErrMessage.LineNo)+"
ÐÐ)",0,"Çë×¢Òâ!")
FINALLY
ENDTRY
No Matter what code I put into thisform.edit1.value, it will always come a
error message.
Anyone can tell me the reason?
Tks In Advance!
Chuen