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
Miscellaneous
Thread ID:
00305973
Message ID:
00305975
Views:
28
Elgin,

STR() without the second parameter is going to return a 10 character long string which is probably bigger than your field from the symptoms.

>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
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform