loop problem

Results 1 to 3 of 3

Thread: loop problem

  1. #1
    8575 Guest

    Default loop problem

    For each ITEM in R.F<BR> <BR> i=i+1<BR><BR> fieldname(i)=ITEM<BR> fieldvalue(i)=R.F(ITEM)<BR> if check 1 then<BR> else<BR> end if<BR> if fieldname="userid" then<BR> check user id<BR> if bad fieldvalue(i)="newid"<BR> else<BR> end if<BR> <BR> build sql<BR> insert into tbl(fieldname(i))Value(fieldvalue(i))<BR><BR>This builds about 10 strings that I need.<BR>Problem is that the first string does not include the userid<BR>I think that the 1st string is created BEFORE the algorthim finds userid so it leaves it blank, but it appears that I have an extra user id at the end of the loop?<BR>The entire code is about 300 lines <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: loop problem

    try doing the i=i+1 AFTER you&#039ve done the actions within the loop - that&#039s your problem<BR><BR>depending on what type of &#039object&#039 you&#039re looping through a<BR><BR>for x = 0 to len(obj)<BR><BR>next<BR><BR>may be better<BR><BR>jason

  3. #3
    Join Date
    Dec 1969

    Default RE: loop problem

    but it didnt work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts