Using a variable as a field number
Jeff Harrison
Jeff.Harrison at Epixweb.com
Mon May 10 12:29:54 PDT 2004
Keith Hamilton wrote:
--------
I'm trying to read a textfile and updating a certain field number from the
textfile.. How would I go about using a variable for a field number like
@menu þ If:
þ
Then: import ASCII uo="/appl/fp/import/orderupdate" R=\n F=~
þ
2 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: RN(10, .0) = uo(1)
þ
3 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: lookup ord = EORDER R=RN -n
þ
4 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: ord(uo(2)) = uo(3)
How would I go about making uo(2) a field number so filePro knows what to do
with it?
-------------------------------------------
If I understand what you are trying to do, all you need to do is dimension
an array against your EORDER file and use the uo(2) as a subscript for this.
However, I would also make the alias of the import statement something
longer than 2 characters to prevent confusion with dummy fields. Also, I
would make sure that you protect the lookup to EORDER and make sure you do a
write to it after your assignment (since it is @menu processing).
For example:
dim flds(999):ord(1):
import ascii uoo=("/appl/fp/import/orderupdate") R=\n F=~
rn(10,.0)=uoo(1)
lookup ord = EORDER r=rn -np
flds(uoo(2))=uoo(3)
write ord
Also, I assume you will want to loop back to your import line so that it
will iterate through your import file and do the updates.
Jeff Harrison
jeff.harrison at epixweb.com
Author of JHExport and JHImport - The fastest and easiest ways to generate
code for filepro exports and imports. Demos available upon request.
More information about the Filepro-list
mailing list