Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I use the field() command in a replace statement.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00353285
Message ID:
00353291
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform