Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seek & Replace
Message
 
 
To
11/04/2007 14:07:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01214576
Message ID:
01214586
Views:
13
>I have been assigned to diddle with parcing a text file. I am able to get it into the proper fields in my databases however I keep erroring out when I get to the replace command. Any help would be great.
>
>
>SELECT QPDATA
>USE IN 0
>GOTO TOP
>SET STEP ON
>SCAN WHILE !EOF()
>QFLD =QPDATA.FIELD    &&FIELD MARKER TO FIND
>XDATA =LXPOS.INPUT   &&FIELD TO MATCH TO
>ORPL =LXPOS.DATA  &&DATA INTO THE LX FILE
>QPLACE = QPDATA.DATA  &&DATA FROM THE QP FILE
>SET ORDER TO FIELD    && FIELD
>SEEK QFLD
>	IF FOUND()
>	REPLACE &ORPL WITH &QPLACE WHERE &XDATA = &QFLD
>ENDIF
>ENDSCAN
USE IN 0
>SET STEP ON
>SCAN 
>QFLD =QPDATA.FIELD    &&FIELD MARKER TO FIND
>XDATA =LXPOS.INPUT   &&FIELD TO MATCH TO
>ORPL =LXPOS.DATA  &&DATA INTO THE LX FILE
>QPLACE = QPDATA.DATA  &&DATA FROM THE QP FILE
*>SET ORDER TO FIELD    && FIELD
*>SEEK QFLD
if seek(Qfld,'myTable','Field')
>	REPLACE &ORPL WITH QPLACE FOR &XDATA = &QFLD && Not sure about last macro and why do we need to replace multiple records? Which file we're sitting on?
>ENDIF
>ENDSCAN
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform