[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: arrays
To a point, I agree. I agree that Daniel's explanation makes sense.
What does not make sense is that SQR allows this in the first place.
Personally, I think it would make more sense for SQR to not allow certain
punctuation characters to be a part of a variable name.
So, you have a variable called $A, and you want to substring it
LET $x = substr($a,,10,#len)
... oops! "incorrect number of arguments"
or you keep track of line number in #line,
PRINT 'test' (#line,,012,04)
... oops! "incorrect number of arguments"
Obviously, having a comma as part of a variable name is going to cause grief in
expressions and since expressions are such an integral part of the SQR command
set, one has to question why SQR permits it.
Anyway, thanks for the explanation Daniel.
>>> "Manning, Shinta" <ShintaManning@FINANCIAL.WELLSFARGO.COM> 2000/12/01
>11:40:12 am >>>
makes sense
> -----Original Message-----
> From: Daniel Vandenberg [SMTP:vandberg@VAXA.CIS.UWOSH.EDU]
> Sent: Friday, December 01, 2000 9:33 AM
> To: SQR-USERS@list.iex.net
> Subject: Re: arrays
>
> The reason this happens is that SQR allows a comma to be part of a
> variable
> name. It accepts $A, and $B, as valid variables, but they are different
> variables than $A and $B. This is not limited to GET and PUT
> commands. For example, SHOW $A, $B, $C would be a valid statement, but
> not
> the same as SHOW $A $B $C. Also, it appears that not just commas, but
> almost any punctuation is allowed in a variable name.
>
> At 07:36 AM 12/01/2000 -0400, you wrote:
> >By the by, here's a little heads-up on the GET and PUT array commands. If
> >you are having a hectic day or perhaps you work in an environment that
> >supports more than one coding language (and most of them use - or allow -
> >commas to separate multiple operands), you accidentally code comma
> >separators between the operands (E.G. "Put $A, $B, $C into
> >my_array(#array_cnt)" instead of "Put
> >$A $B $C into my_array(#array_cnt)"), SQR will not flag a compilation
> >error or cause a runtime error, the Get or Put just won't work as
> >expected. That little oversight by SQR can cause you hours, if not days
> >(if the program is complex enough), of debugging time.
> >
> >Peter
>
>
> --------------------------------------------------------------------------
> --
> ----
> Daniel Vandenberg | Phone: (920) 424-3002
> Applications Programming | Fax: (920) 424-7317
> University of Wisconsin Oshkosh |
> 800 Algoma Boulevard | Email :
> vandberg@uwosh.edu
> Oshkosh, WI 54901 |