Variable Assignments
Jose Lerebours
fpgroups at gmail.com
Sun Aug 21 06:55:04 PDT 2016
There might be a way to do what you're looking for but I'm just not aware.
BTW, I normally place the array on line one or first executable line of
the processing table; this way, the array is valid throughout the entire
script. Again, back in the days, if you referenced an array above or
prior to its declaration, you will run into a syntax error or an error
of sort.
On 08/21/2016 01:59 AM, Stanley - stanlyn.com via Filepro-list wrote:
> Thanks Jose,
>
> I was hoping for a simple function that allows getting at the data by
> passing a variable containing the field number. Looks like it is not
> supported. I'll try your idea and that should work, just a bit overkill .
>
> Thanks again,
> Stanley
>
>
>
>
>
> -----Original Message-----
> From: Filepro-list
> [mailto:filepro-list-bounces+stanley=stanlyn.com at lists.celestial.com] On
> Behalf Of Jose Lerebours via Filepro-list
> Sent: Sunday, August 21, 2016 1:32 AM
> To: filepro-list at lists.celestial.com
> Subject: Re: Variable Assignments
>
> Stanley, try associating your fixed fields to an array and then "reference"
> the array by its numeric element - AFAIK, filePro cannot access fixed fields
> by associative reference or dynamic variable construct other than as
> follows.
>
> So, if you were to
>
> dim fixedF(999):1
>
> and then set your counter up/down and to obtain the value of the fixed field
> relative to your counter, you will simply reference the associative array
> like so
>
> then: Aa="9"+"1"; Fn=fixedF(Aa);
>
> If memory does not fail me, Fn should now have the same value as fixed field
> 10 ...
>
>
> NOTE: Be careful in using this practice since any change to the array
> will effectively change the fixed field. If you clear the array, you
> are clearing the values of the fields - This is both, powerful and
> dangerous! ;-)
>
>
> Good luck!
>
>
>
> On 08/21/2016 01:23 AM, Stanley - stanlyn.com via Filepro-list wrote:
>> Hi,
>>
>> How do I get the value of a field (by number) when calculating an offset?
>>
>> Normally if field 10 equals "test" and we assign aa=10, the value of aa is
> "test". This works as expected.
>> When I calculate the offset for the field whose value I need, I cannot get
> a result of "test" if the variable (from the offset calculation) equals 10.
> It is returning 10 instead of "test". So how do I get it to return the
> value of field x?
>> Aa="9"+"1"
>>
>> Fn=aa ' returns the number 10 instead of the value of field 10
>>
>> I've tried fn=(aa) and fn=((aa)) and both returns 10
>>
>> Thanks,
>> Stanley
>>
>>
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list