Vlad,
I never post until I've found that the behavior described in HELP does not work, or the help is incomplete. Perhaps you can reproduce my error, or perhaps it will not happen on your system. Take the following PRG:
on error do errhand with message(1)
Syntax Error Here
procedure errhand
lparam lcMessage1
messagebox(lcMessage1)
When run at the command window, this program gives "Syntax Error Here". Compile it in an exe with debugging information, run it from the command line, and it gives "Do Test.exe"
Perplexing. VFP 6 w/SP3 on NT, though it also happens on a machine w/2k and SP4.
>Hi!
>
>In the help:
>>>>>>
>Parameters
>1
>If MESSAGE( ) is used in an ON ERROR routine, include this argument to return the
program source code that caused the error. If the program source code isn't available, MESSAGE(1) returns one of the following:
>The entire program line if the line is macro substituted.
>
A command if the line contains a command without any additional clauses. >A command followed by three dots (...) if the line contains a command and additional clauses.
>>>>>>
>When you do not include the debugging information when EXE is compiled, it will never return other than you have. When you want to use proper error reporting from client machines, you have to compile EXE with debug information. Of course, this will cause EXE file is larger and source code could be seen inside of the EXE, but you will be able to track the errors properly, for example, get correct values of message(1) and lineno() functions.
>
>HTH.
>
>>Folks,
>>
>>I haven't coded an error handler in some time, and am running into the strangest problem.
>>
>>Simply put, Message(1) returns what I expect when running an app from the command window, but in run-time I'm getting the command that launched the app, as in "Do Sysrun.exe".
>>
>>I'm baffled, and have not looked at this in a very long time. Any ideas?