You'll need to set a variable to hold the retun value of the Field() function.
For example:
cField = field(nCntr)
replace (cField) with alltrim(fgets(nFile))
>I am trying to write a generic import program where the user can select a table and specify a path and this program will read in the data.
>
>I am getting an error with my replace command.
>
>
>do while !feof(nFileHandle)
> select &cTable
> append blank
> for nCntr = 1 to fcount(cTable)
> do case
> case type(field(nCntr)) = "C"
> replace eval(field(nCntr)) with alltrim(fgets(nFile))
> case type(field(nCntr)) = "N"
> replace field(nCntr) with val(fgets(nFile))
> .
> .
> .
> otherwise
> endcase
> endfor
>enddo
>
>
>I've tried replace eval(field(nCntr)) with alltrim(fgets(nFile)) and replace field(ncntr) with alltrim(fgets(nFile))
>
>But I keep getting the error: "Phrase contains unrecognized phrase/keyword"
>
>Is there a way to do this?
>
>Thanks,
>Paul Acton
Henry Petry
AeroHunter.com