Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I use the field() command in a replace statement.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Can I use the field() command in a replace statement.
Miscellaneous
Thread ID:
00353285
Message ID:
00353285
Views:
52
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
Next
Reply
Map
View

Click here to load this message in the networking platform