WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: kdmoyers on April 29, 2019, 04:51:13 AM

Title: small Analyzer quibble
Post by: kdmoyers on April 29, 2019, 04:51:13 AM
The analyzer complains "error 5025: Expression continues past logical end" about line 6
but line 6 does work as intended.  Maybe analyzer needs a tweak?  Not sure.

(PS: I'm loving the new maps.)

Code (winbatch) Select

    Const = MapCreate()
    ptrglobaldefine(Const)
    Const["mastertitle"] = "Fancy"

    #definefunction croak(a,c)
      mt = *ptrGlobal(Const)["mastertitle"]
      terminate(a,mt,c)
      return
    #endfunction

    croak(1,"bye bye")

    exit
Title: Re: small Analyzer quibble
Post by: stanl on April 29, 2019, 05:52:49 AM
I can't replicate your code, but maybe move the function at the beginning of the script, or after exit as a gosub :UDFS 
Title: Re: small Analyzer quibble
Post by: kdmoyers on April 29, 2019, 07:52:00 AM
Good idea, I'll try it....
...nope, it just follows the line around where ever you put it.

I think the syntax analyzer is just not fond of the syntax on that line.
Title: Re: small Analyzer quibble
Post by: td on April 29, 2019, 08:30:09 AM
You certainly like to play with WIL pointers.   The problem in the syntax analyzer is not specific to WIL maps.  You can reproduce it using conventional WIL arrays as well.  The analyzer does not like a function call preceding the array expression in this case.   We will get it straightened out for the next release.

As per usual, thanks for reporting the problem.
Title: Re: small Analyzer quibble
Post by: td on April 29, 2019, 01:41:46 PM
You won the dailydouble.  Run the following through the Analyzer and the WBS debugger.

Code (winbatch) Select
#definefunction Useless(_p)
   return _p
#endfunction

a[0] = 1
x = *Useless(&a)[0]
Title: Re: small Analyzer quibble
Post by: td on April 30, 2019, 09:13:28 AM
One final note on the subject.  Array brackets probably should not be permitted following function calls in WIL statements for syntax consistency's sake. But once the cat is out there is no putting it back in the bag.
Title: Re: small Analyzer quibble
Post by: kdmoyers on May 01, 2019, 11:25:19 AM
QuoteYou certainly like to play with WIL pointers

Guilty as charged, sir!

Quote from: td on April 30, 2019, 09:13:28 AMOne final note on the subject.  Array brackets probably should not be permitted following function calls in WIL statements for syntax consistency's sake. But once the cat is out there is no putting it back in the bag.

Thanks for making allowances for our cats Tony!  :)

             _,'|             _.-''``-...___..--';
           /_ \'.      __..-' ,      ,--...--'''
          <\    .`--'''       `     /'
           `-';'               ;   ; ;
     __...--''     ___...--_..'  .;.'
    (,__....----'''       (,..--''