Click to See Complete Forum and Search --> : Arrays


bloke
05-27-2003, 06:43 AM
Folks

I'm suffering from brain malfunction yet again (must be the Bank Holiday).

This:
<%strrecipientslist = "&quot;" & replace(rsallcorres("recipients"), ",", "&quot;,&quot;") & "&quot;"
recipArray = array(strrecipientslist)
Dim iLoop
For iLoop = lBound(recipArray) to UBound(recipArray)
response.write recipArray(iLoop) & "<br>"
Next
%>

....should return

Noel
John
Phil

(given that "&quot;" & replace(rsallcorres("recipients"), ",", "&quot;,&quot;") & "&quot;" returns "Noel","John","Phil"

But instead it returns

"Noel","John","Phil"

ps, I am using '& quot ;' in the replace function but it appearing in the post as """...

I'm probably just being a bit stupid here but can anyone help before I go mad?

Cheers

bloke
05-27-2003, 09:09 AM
Yes, but if I remove the '& quot ;' from the beginning and end of the variable, it returns:

Noel","John"," Phil

The value in the recordset, by the way, is simply:

Noel,John,Phil (entered in one form field, comma separated). I may be going about this all wrong but I just want to break this one string down into an array....

bloke
05-27-2003, 10:18 AM
Doh! Just used Split. Told you I was having a malfunction.