Friday, May 21, 2010

How do you concatenate a integer onto a variable in a loop in ASP. I'm using the & but it dosen't work?

This is what I'm trying to do





for i = 1 to 10


if a%26gt;0 then


check%26amp;i = check%26amp;i +1





Essentially check%26amp;1 will become check1, check2, check3, check4 in the loop. I tried using check%26amp;response.Write(i) but it didnt' work

How do you concatenate a integer onto a variable in a loop in ASP. I'm using the %26amp; but it dosen't work?
cstr(check(i)) = cstr(check(i)) %26amp; "1"
Reply:you need to encapsulate it as a string using a string function.





Careful!!! Validate the data you are concatenating to make sure you are CAT'ing numerics or you will have an error.


No comments:

Post a Comment