View previous topic :: View next topic |
Author |
Message |
DaveR Valued Contributor
Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sun May 31, 2009 8:13 am Post subject: VDS 6 error messages |
|
|
The help files for VDS 5 and VDS 6 list some different explainations for some error numbers.
Runtime Error 17
VDS 5 = Dialog already exists
VDS 6 = Image is not a 16x16 bitmap
Runtime Error 20
VDS 5 = (The file or directory referenced in a command does not exist)
VDS 6 = (The image file that you are trying to load into a BITMAP or TASKICON element does not exist)
Runtime Error 30
VDS 5 = Breakpoint reached
VDS 6 = I/O Error
Runtime Error 31
VDS 5 = Stopped by user
VDS 6 = Command failed
While updating and refining my 'error-msg' include file I wondered which error messages should be used for a VDS 5 executable if it was compiled within the VDS 6 IDE? (VDS 5 or VDS 6 error messages)
Should a VDS 5 application that was compiled with VDS 6 use the following:
Code: | if @equal(%%ErrNum,31)
if @greater(6.0,@sysinfo(dsver))
# VDS 5 error
%%Msg = Stopped by user
else
# VDS 6 error
%%Msg = Command failed
end
end |
Or just use the same error messages as a VDS 6 application would? Code: | if @equal(%%ErrNum,31)
# VDS 6 error
%%Msg = Command failed
end |
_________________ cheers
Dave |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun May 31, 2009 5:42 pm Post subject: |
|
|
One would assume that it would keep the proper error messages for each intact, but as we've heard before if you assume, you make an *mule* of you and me...
I've only been using the VDS 6 side of it, so I can't say if it does keep the error messages separate or not. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jun 01, 2009 2:16 pm Post subject: |
|
|
Hmmm it seems that when compiled in the VDS 6 editor as a VDS 5 executable the error codes return the same verbage as VDS 6 with the exception of error code 20 it returns "File does not exist". You can check this by using the "Error" command. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
DaveR Valued Contributor
Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Tue Jun 02, 2009 10:29 am Post subject: |
|
|
dragonsphere wrote: | You can check this by using the "Error" command. |
Ahh yes, I forgot about that.
dragonsphere wrote: | with the exception of error code 20 it returns "File does not exist". |
Sorry, for error 20 I posted the explanation from the help files, instead of the description (because the description was so similiar).
Code: | Runtime Error 20
VDS 5 = File or path does not exist.
(The file or directory referenced in a command does not exist)
VDS 6 = File does not exist.
(The image file that you are trying to load into a BITMAP or TASKICON element does not exist) |
dragonsphere wrote: | Hmmm it seems that when compiled in the VDS 6 editor as a VDS 5 executable the error codes return the same verbage as VDS 6 |
Ok, so seeing as the version of vdsrun50.dll included with VDS 6 is 5.1, and if I remember correctly that last VDS 5 version of vdsrun50.dll was 5.02, something like the following should work ok (by checking if the vds version is greater than 5.05).
Code: | if @equal(%%ErrNum,31)
if @greater(5.05,@sysinfo(dsver))
# VDS 5 error
%%Msg = Stopped by user
else
# VDS 6 error (or VDS 5.1 compiled in VDS 6)
%%Msg = Command failed
end
end |
_________________ cheers
Dave |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Jun 02, 2009 2:50 pm Post subject: |
|
|
Is that the only error number that differs? _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
DaveR Valued Contributor
Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Wed Jun 03, 2009 4:12 pm Post subject: |
|
|
Error 20 has slightly different wording but could mean the same thing. Errors 17, 30 and 31 are completely different. And errors 43 to 46 are VDS 6 only.
Here's my full error message function, and a very simple errortrap that uses the function.
Code: | #define function,ErrMsg
option errortrap,ErrTrap
:ErrTrap
%%Error = @error(e)
%%ErrLineNum = @error(n)
warn @ErrMsg(%%Error) : Error %%Error at line %%ErrLineNum
stop
:ErrMsg
if @numeric(%1)
# VDS 5 and 6 errors
if @equal(%1,1)
%m = Invalid command
elsif @equal(%1,2)
%m = Missing command parameters
elsif @equal(%1,3)
%m = Style already defined
elsif @equal(%1,4)
%m = Invalid list operation
elsif @equal(%1,5)
%m = Invalid variable name or too many variables
elsif @equal(%1,6)
%m = Missing equal symbol
elsif @equal(%1,7)
%m = Invalid function
elsif @equal(%1,8)
%m = Syntax error in function
elsif @equal(%1,9)
%m = Missing END or ELSE
elsif @equal(%1,10)
%m = Command or function nested too deeply
elsif @equal(%1,11)
%m = Missing arguments to function
elsif @equal(%1,12)
%m = Label not found
elsif @equal(%1,13)
%m = Invalid argument to function
elsif @equal(%1,14)
%m = Invalid parameter to command
elsif @equal(%1,15)
%m = UNTIL without REPEAT
elsif @equal(%1,16)
%m = Invalid dialog style
elsif @equal(%1,17)
if @greater(5.09,@sysinfo(dsver))
# VDS 5 error
%m = Dialog already exists
else
# VDS 6 error
%m = Image is not a 16x16 bitmap
end
elsif @equal(%1,18)
%m = Dialog or dialog element does not exist
elsif @equal(%1,19)
%m = List index out of range
elsif @equal(%1,20)
if @greater(5.09,@sysinfo(dsver))
# VDS 5 error
%m = File or path does not exist
else
# VDS 6 error
%m = Image file does not exist
end
elsif @equal(%1,21)
%m = Cannot create dialog element
elsif @equal(%1,22)
%m = Operation invalid when no dialog showing
elsif @equal(%1,23)
%m = Dialog element name not valid
elsif @equal(%1,24)
%m = Mismatched brackets
elsif @equal(%1,25)
%m = Non-numeric value in arithmetic command or function
elsif @equal(%1,26)
%m = Arithmetic error
elsif @equal(%1,27)
%m = Fatal untrapped error in an external command or function
elsif @equal(%1,28)
%m = External library %%LoadDLL not available
elsif @equal(%1,29)
%m = Insufficient system memory for operation
elsif @equal(%1,30)
if @greater(5.09,@sysinfo(dsver))
# VDS 5 error
%m = Breakpoint reached
else
# VDS 6 error
%m = File input or output operation is invalid
end
elsif @equal(%1,31)
if @greater(5.09,@sysinfo(dsver))
# VDS 5 error
%m = Stopped by user
else
# VDS 6 error
%m = Command failed
end
elsif @equal(%1,32)
%m = User-defined error in external command
elsif @equal(%1,33)
%m = Unhandled exception in external library
elsif @equal(%1,34)
%m = WEND missing
elsif @equal(%1,35)
%m = WEND without WHILE
elsif @equal(%1,36)
%m = Too many system timers
elsif @equal(%1,37)
%m = Cannot load resource
elsif @equal(%1,38)
%m = Library function not found
elsif @equal(%1,39)
%m = Error calling library function
elsif @equal(%1,40)
%m = Library not loaded
elsif @equal(%1,41)
%m = Too many DLL function arguments
elsif @equal(%1,42)
%m = Current command or function invalid
# VDS 6 only errors
elsif @equal(%1,43)
%m = Invalid binfile or xmldoc identifier
elsif @equal(%1,44)
%m = Too many open binfiles
elsif @equal(%1,45)
%m = Too many string lists
elsif @equal(%1,46)
%m = Too many open XML documents
end
else
%m = %1
end
exit %m |
_________________ cheers
Dave |
|
Back to top |
|
|
DavidR Contributor
Joined: 05 Aug 2003 Posts: 83 Location: Bethel Pennsylvania U.S.A.
|
Posted: Tue Sep 01, 2009 10:29 am Post subject: |
|
|
Very nice Dave. I'll incorporate this in some of my own programs.
Thanks for sharing!
..........David |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|