>1. MODIFY COMMAND temp.prg
>2. Copy code below into the open temp.prg
>3. ALT+P+M to compile it
>4. Observerd: ERROR: Command contains unrecognized phrase/keyword.
>
>5. Click Cancel to dismiss the messagebox with error
>6. CTRL+E to run the same code
>7. Observerd: Code runs w/o error and ouputs "Invalid Type" to the desktop
>Expected: The same error as in 4.
>
>
>lnDriveType = 0
>DO CASE
>CASE lnDriveType = 6
> lcDriveType = "RAM disk
>OTHERWISE
> ? "Invalid Type"
>ENDCASE
>
>
>Comments: I thought that CTRL+E causes code to be compiled as with ALT+P+M and then run but it seems not to be the case.
CTRL+E is a DO shortcut, it compile the file with a COMPILE command.
COMPILE command doesn't interact with the user,
and this can to be "by design" into a full dynamic language as VFP,
but if this is the design choice, it is wrong,
because it create a difference among COMPILE and EXECSCRIPT.
At design time this is a minor issue, but at runtime this can to generate side effects,
because COMPILE and/or DO execute the correct code, and generate errors inside the compiled code,
execscript require a perfect syntax code to execute the first line.
EXECSCRIPT is correct for me,
and backward compatibility it is not a good reason to keep on being wrong.
TEXT TO wrongCode NOSHOW
lcDriveType < 12a
ENDTEXT
ERASE WRONGCODE.*
STRTOFILE(m.wrongCode,"wrongCode.prg")
COMPILE wrongCode.PRG
IF FILE("wrongCode.ERR")
MESSAGEBOX(FILETOSTR("wrongCode.ERR"),"ERROR FILE")
ENDIF
DO wrongCode.FXP
EXECSCRIPT(m.wrongCode)