array is killing me

# Thread: array is killing me

1. Junior Member
Join Date
Dec 1969
Posts
7

## array is killing me

this here:<BR><BR>Dim x, xx, eqArr(), i, iCount<BR>x=CInt(myRS("myTotal"))<BR>xx=x-1<BR>ReDim Preserve eqArr(xx)<BR>iCount = 0<BR>FOR i = 0 to UBOUND(eqArr)<BR>iCount = iCount + 1 & ", "<BR>Response.Write iCount<BR>NEXT<BR><BR>will write:<BR>1, 2, 3, <BR><BR>I need to be able to write:<BR>1, 2, 3<BR>note there is no comma after the 3. thats what i am shooting for.<BR><BR>thanks in advance for bailing me out

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: array is killing me

Dim x, xx, eqArr(), i, iCount<BR>x=CInt(myRS("myTotal"))<BR>xx=x-1<BR>ReDim Preserve eqArr(xx)<BR>iCount = 0<BR>FOR i = 0 to UBOUND(eqArr)<BR>iCount = iCount + 1 & ", "<BR>NEXT<BR>iCount = Trim(iCount)<BR>if Right(iCount, 1) = "," then iCount = Left(iCount, Len(iCount)-1)<BR>Response.Write iCount<BR><BR>This is basic string manipulation...<BR><BR>Craig.

3. Senior Member
Join Date
Dec 1969
Posts
5,104

## RE: array is killing me

Dim x, xx, eqArr(), i, iCount<BR>x=CInt(myRS("myTotal"))<BR>xx=x-1<BR>ReDim Preserve eqArr(xx)<BR>iCount = 0<BR>FOR i = 0 to UBOUND(eqArr)<BR>iCount = iCount + 1<BR>Response.Write iCount<BR>If i &#060; UBound(erArr) Then Response.Write ","<BR>NEXT

#### Posting Permissions

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