[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Array unknown to called procedure in included file



Try moving the #include command to after the create-array command.

The recommended program structure is to have the begin-setup section first,
then #include, then rest of the program. Place the
create-array in the begin-setup section.

Gadi.

----------
From: Simonian, Guy <SimonianG@AETNA.COM>
To: Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
Subject: Array unknown to called procedure in included file
Date: Monday, October 06, 1997 9:22 AM

Arrays seem to work fine when all the procedures that use them are in
the same file.  I get the following error however when referencing an
array within a procedure in an included file;

   (SQR 3506) Array specified not defined with CREATE-ARRAY.

Here are the two sample files:
-------------------------------------------------file
1----------------------------------------------
! filename is test.sqr
#include 'test1.sqr'
begin-program
        create-array name=sshell size=1000
        field=shell_line:char
do outside_file_test
end-program

------------------------------------------------file
2--------------------------------
! filename is test1.sqr
begin-procedure outside_file_test
get $os from sshell(1)
end-procedure