Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't do a simple REPLACE command
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Can't do a simple REPLACE command
Miscellaneous
Thread ID:
00305973
Message ID:
00305973
Views:
41
I am using the following piece of code:

************************
SELECT 1
GO TOP
DO WHILE .NOT. EOF()
cDupeId=EVALUATE(SYS(14,1)) && Get the Value of index tag number 1
SKIP
IF cDupeId=EVALUATE(SYS(14,1))
REPLACE samplenum WITH STR(VAL(samplenum)+1)
*BROWSE
ENDIF
ENDDO
*************************

The "samplenum" field is character type. However, when a duplicate on the index is found, it just blanks out the field. It doesn't replace it with the incremented value as I want it to.

For the most part the index tag #1 is made of up of a date+tank+apparatus+samplenum. And the data always starts with the samplenum equal to 1 in every case. When the complete index tag number 1 evaluates to a duplicate, I want it to increment the samplenum by one so it will no longer be a duplicate.

Thanks
Elgin Rogers Jr
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Next
Reply
Map
View

Click here to load this message in the networking platform