RG>In Cobol, we called them tables, with OCCURS clauses and indexes or
RG>subscripts. In C, they were arrays, again with pointers.
RG>I want to have 50 identically defined fields in a record, and reference
these
RG>fields using an offset or an index. I don't care if the index is relative
to
RG>one or zero, but I just can't find any documentation....
RG>For example.
RG>Name
RG>Qty[1]
RG>Qty[2]
RG>....
RG>Qty[50]
RG>Can someone help?
Well, the problem is that coming from COBOL and C, the Paradox
solution is too easy. (The syntax and dynamic arrays have a hint of
C or Pascal). ASSUME PDOX45 for DOS. (but the theory is the same)
Open the table on the workspace
(1) simply with View or Edit
or (2) perhaps a moveto |window| or |field| ... see online help syntax
Use built in features like SCAN [for boolean] some_command ENDSCAN
which does the indexing behind the scenes.
SCAN for [SomeField] > SomeVariable
[SomeField]=SomeField*Surcharge
ENDSCAN
like C, PAL doesn't care if it's all one line or not.
or
use the semiunique
ARRAY R_ray[nrecords("TableX") ;a dos file TableX.DB
FOR SomeVar FROM X to Z [step n]
R_ray[X]=Whadyawannado ;from X, means 0,1 or X based!
ENDFOR
Online help and the book that comes with Paradox is a great tutor.
Many examples exist for you capture Borland's download service.
Am I in the ballpark...was this what you were asking about?
Bye
---
* SLMR 2.1 * He shall come in the clouds, and every eye shall see Him.
--- QScan/PCB v1.16b / 01-0024
---------------
* Origin: (1:3407/14)
|