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

Re: ARRAYS



> Dynamic arrays? I have the following routine for this.
> It works for me, but then I am still green in the SQR world.
> angel_guzman@trfb.navy.mil
>
>
> #define $1array-name  dparray
> #define #1elements    11
> #define #1size        3
>
> ............................
>
> Begin-Procedure Get-Parameters
>    create-array name={$1array-name} size={#1elements} field=departments:char
>    do get_data(8,5,'{$1array-name}',{#1elements},{#1size})
> End-Procedure
>
> ............................
>
>
> Begin-Procedure get_data(#line,#column,$name,#elements,#fieldlen)
> ----------------------------
> ----------------------------
> End-Procedure
>
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Angel,

I can't quite tell from your example, but it looks like you're using
the #define feature to configure the array at compile time (not at
run time).  I don't think you could create an SQT file that would
allow you to type in the size of the array at runtime.  What I'm
looking for is a mechanism to allow me to calculate the array size
at runtime (using a #variable, not a {variable}).

Ray

----------------------------------------------------------------------
Ray Ontko       |  Ray Ontko & Co  |  "Ask me about our SQR toolkit."
rayo@ontko.com  |  Richmond, In    |  See us at http://www.ontko.com/