Trying to write an import script
Keith Hamilton
khamilton at ex-cell.com
Mon Mar 1 07:49:05 PST 2004
Hi Guys,
Im trying to write an import script to update selected fields and
records in a filePro file. I have everything written but I cant seem to
figure out how to have a variable for a field name. The problem is on line
14 where I try to have it update a field number with a variable. Please let
me know if this can be done or not.
-- Keith
@menu þ If: exists("import/customerimport") le "0"
þ
Then: end
þ
2 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: TL(255, ASCII); TI(255, ASCII); TC(2, *); NB(50, *); TD(3, .0);
þ
3 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: TF = open("import/customerimport", "rt")
þ
4 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: NB = readline(TF, TL)
þ
5 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: TI = mid(TL, 1, instr(TL, "~"))
þ
6 ------- - - - - - - - - - - - - - - - -
þ If: not TI eq "1"
þ
Then: end
þ
7 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: lookup cust = EXCUST K=TI i=A -NX; NC(1, .0) = "0"
þ
8 ------- - - - - - - - - - - - - - - - -
þ If: not cust
þ
Then: end
þ
9 ------- - - - - - - - - - - - - - - - -
loopf þ If:
þ
Then: NB = readline(TF, TL)
þ
10 ------- - - - - - - - - - - - - - - - -
þ If: NB le "0"
þ
Then: goto closeup
þ
11 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: TC = instr(TL, "~")
þ
12 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: TD = int(mid(TL, 1, TC)); TC = TC + "1"
þ
13 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: TC = mid(TL, TC, len(TL))
þ
14 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: cust(TD) = TC;
þ
15 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: goto loopf
þ
16 ------- - - - - - - - - - - - - - - - -
closeupþ If:
þ
Then: write cust
þ
17 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: close cust
þ
18 ------- - - - - - - - - - - - - - - - -
þ If:
þ
Then: end
þ
More information about the Filepro-list
mailing list