Maybe there's a fix?

Started by George Vagenas, July 15, 2013, 01:39:48 AM

Previous topic - Next topic

George Vagenas

Took me a while to figure out the problem the StrCat structure is correct.

Code (winbatch) Select

   intcontrol(73, 2, 0, 0, 0)   ; GOSUB error handler.
   Tails = 'Tails'
   Heads = 'Heads'
   fName = strcat(Heads, ' or ', Tails, '.', Ext)
   clipput(fName)

:Cancel
   return


;__________________________________________________________________________________________
:WBERRORHANDLER
   Error = LastError()
   
   if Error==2058    ; StrCat: Function syntax error   
      ; Deal with it.
      fName = Heads : ' or ' : Tails : '.' : Ext
      return
   endif
   
   ErrInfo = strcat('Error: #', Error, ': ', wberrortextstring, @crlf, 'Script: ', wberrorhandlerline, @crlf, 'Assignment: ', wberrorhandlerassignment, @crlf, 'File: ', wberrorhandlerfile, @crlf, 'Procedure: ', wberrorinsegment, @crlf, 'Line No. ', wberrorhandlerlinenumber, @crlf)
   clipput(ErrInfo)
   pause('Error Message on Clipboard', ErrInfo)

   exit

This line
Code (winbatch) Select

fName = Heads : ' or ' : Tails : '.' : Ext

comes up with the right error message.
Thanks

George

Deana

Are you suggesting that the StrCat function should return the fatal error 3052: Uninitialized variable or undefined function rather than the moderate error 2058: StrCat function syntax error?
Deana F.
Technical Support
Wilson WindowWare Inc.

George Vagenas

The fatal error.  If the variables used are not defined in close proximity to the function (which was my situation) then it can take a fair bit of time to figure out why the statement is causing an error.
Thanks

George

Deana

The developers have been notified of your request.
Deana F.
Technical Support
Wilson WindowWare Inc.