[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
SQR Create Array
Hello all,
Another Programmer here fell into a common pitfall with arrays
yesterday, and while I was thinking about it I thought I'd pose this as
a possible enhancement to SQR at some future date, as well as a technical
note.
Our Programming Standards require that all procedures are alphabetized.
A program starts with the Setup and Report Sections and then is followed by
the procedures in alphabetical order.
If I have an Access Array procedure and a Create Array procedure
in alphabetical order, the array access statement in the Access Array
procedure will generate an error stating that the array has not been created.
The logical calling of these procedures is correct though. This occurs
because SQR did not physically encounter the CREATE ARRAY before the GET or PUT
statement.
I make it a standard practice to define all arrays in either the REPORT
section, or the Setup section since they are the first two sections in our
programs, and arrays are most usually global in nature. I understand compiler
design enough to know why this occurs, and that there is not a quick
modification to resolve this either. The error can cause confusion if a
programmer is not aware of this.
Thanks,
Scott May
****************************************************************
* Programmer / Analyst | State University of New York *
* SICAS Center | SUCO *
* | Lee Hall *
* Internet: maysa@oneonta.edu | Oneonta, NY 13820 *
****************************************************************