Import Question

Kenneth Brody kenbrody at spamcop.net
Tue Sep 22 08:10:27 PDT 2009


Brandt Eppler wrote:
> Hi All,
> 
> Can you use a variable when defining fields in an import? 
[...]
> ::fc(2,.0)="1"            'Field Count:
> loop::IMPORT ASCII ref=/tmp/stuff  R=\n F=,:
> :not ref:end:
> ::nn(10,*)=ref(fc);fc=fc+"1":
> ::fs(35,*)=ref(fc);fc=fc+"1":
[...]

There is currently no documented way of using a variable for the import 
field number.

You could fill an array with the import fields, and then use your "fc" 
subscript into the array.  For example:

     import ascii foo=/tmp/stuff r-\n f=,

     If: not foo
   Then: end

     dim ref[99]
     ref["1"] = foo[1]
     ref["2"] = foo[2]
     ref["3"] = foo[3]
     ...
     nn(10,*) = ref[fc] ; fc = fc + "1"
     fs(35,*) = ref[fc] ; fc = fc + "1"
     ...

-- 
Kenneth Brody


More information about the Filepro-list mailing list