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

SQR Array Question.




	I am having some difficulty with creating procedures to handle
my simple array operations, before I even get to the tough ones.

	I am using the following INSERT procedure(function) for the array.

BEGIN-PROCEDURE INSERT_ARRAY(#pidm, $deli_code, $rec_type, #position, :#status)

  if #position >= {array_size}
    move 0 to #status
  else
    move 1 to #status
    put #pidm      into deli_array(#position)  deli_array_pidm
    put $deli_code into deli_array(#position)  deli_array_deli_code
    put $rec_type  into deli_array(#position)  deli_array_rec_type
    get #pidm_1, $deli_code_1, $rec_type_1, $err_flg_1 from deli_array(#positio
    show (+1,1) #pidm_1 ' ' $deli_code_1 ' ' $rec_type_1 ' ' $err_flg_1 ' - ' #
  end-if

END-PROCEDURE INSERT_ARRAY

	The array is Global, the procedure is local.  Therefore I can not 
insert into the array.  I am using 2.11, 2.27, and 2.42 versions of SQR. 
How do I tell the procedure that the array I want to insert into is 
a global array?  I can access all other global vars with the $_, #_, and &_.
Does some prefix for the array exist?

	And as a curious side note, why does SQR acknowledge the existence
of the array in the local procedure?  It doesn't say the array doesn't exist,
within the local procedure, eventhough for all uses it doesn't!  I would
think that if the compiler took the time to decide that the procedure 
could not insert into the global array that it would be a logical progression
to state that it was an error.

	I have wore the binding out of my programming manual, and could not 
find any refrences to dealing with arrays on a global/local basis.  I have
also tried to recreate the array within the local procedure, since it is
not seeing the global array, and I get a duplicate array created error,
so I know that SQR sees the global array inside the local procedure.

Help!

Thanks in advance,
Scott...
************************************************************
* Programmer / Analyst    |   Internet: maysa@oneonta.edu  *
* SICAS Center            |   SUNY Oneonta                 *
*                         |   Lee Hall                     *
*                         |   Oneonta, NY  13820           *
************************************************************