Author Topic: Maybe there's a fix?  (Read 3162 times)

George Vagenas

  • Full Member
  • ***
  • Posts: 102
Maybe there's a fix?
« on: July 15, 2013, 01:39:48 am »
Took me a while to figure out the problem the StrCat structure is correct.

Code: Winbatch
   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
fName = Heads : ' or ' : Tails : '.' : Ext
 
comes up with the right error message.
Thanks

George

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Maybe there's a fix?
« Reply #1 on: July 15, 2013, 08:28:03 am »
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

  • Full Member
  • ***
  • Posts: 102
Re: Maybe there's a fix?
« Reply #2 on: July 15, 2013, 12:42:00 pm »
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

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Maybe there's a fix?
« Reply #3 on: July 15, 2013, 01:09:24 pm »
The developers have been notified of your request.
Deana F.
Technical Support
Wilson WindowWare Inc.