Question

Asked on 2009-10-21 at 01:32:36ID: 25040656

incrementing in vfp

by: ClaytonGlass250

Rating9.3Excellent

Hi:
I have a free table and I need to replace a field value  (called auto; its an integer)with an incremental number starting at 1.
Ithought I had a nice loop but the field does not update; neither first nor subsequent records.
My code is attached; does anybody know where I have gone wrong?
Thanks!
The messagebox was just to prove the array nCount is valid. It will be remioved in the final version.

USE "R:\data\barcode\lrbatch2.dbf" EXCLUSIVE
COPY TO ARRAY BatchC FIELDS auto
nCount = ALEN(BatchC,1)
icnt = 1
DO WHILE icnt < nCount
REPLACE auto WITH icnt
icnt = icnt +1
ENDDO
MESSAGEBOX(nCount,1)
                              
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window

Related Solutions

Solution

Access this solution immediately by signing up as a member of FoxproAnswers.com--it’s quick, easy, and secure. We will return you to this solution, unlocked, when you’re done.

About this Solution
Sign up Now to View This Solution
Zone
general
Tags
vfp
Participating Experts
1
Solution Grade
A

Replies

 by: pcelba

Posted on 2009-10-21 at 01:43:07ID: 26270601

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: pcelba

Posted on 2009-10-21 at 01:56:23ID: 26270602

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Log In

Forgot your password?Sign up

Top Experts

  1. pcelba

    4,240

    0 points yesterday

    Profile
  2. mozner

    2,000

    0 points yesterday

    Profile
  3. mbarbir

    1,912

    0 points yesterday

    Profile
  4. jrbbldr

    1,500

    0 points yesterday

    Profile

BrowseAre you an Expert?