Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FoxPro field help!

Status
Not open for further replies.

starskyuk

Programmer
Jun 6, 2001
2
US
Hi

Basically I want to put some information into a field on a databse. The number generated appends onto the field and this works in the command menu as a test. The problem I have is that i don't know how to encorporate this into the replace statement. This is generated in a while loop so the field numbers will change.

if FIELD(2) contains the info i would like to use.

replace FIELD(2) with 'hello'

Many thanks for any help offered.

Steve
 
Hi Steve,

Try:

fieldname = 'field' + ALLTRIM(STR(mynumber))
REPLACE (fieldname) WITH 'hello'

Jim
 
FOR I=1 TO FCOUNT()
IF "THE INFORMATION YOU LOOKING FOR" $ UPPER(EVAL(FIELD(I)))
lcTheFieldName=FIELD(I)
REPLACE (lcTheFieldName) WITH "HELLO"
EXIT
ENDIF
ENDFOR Walid Magd
Engwam@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top