Hi,

I'm using the Classic ASP/VB Script language, and there is no Implode
function. So this code:

while NOT gamesdisplay.EOF
ggd = gamesdisplay("gamecount") &","
gamesdisplay.movenext()
ggd2 = ggd2 & ggd
wend

Basically gets everything in order, apart from the trailing comma.
Which the Len removes. I've done some searching, and as far as I can
see, this is quite effective in what I need to do in ASP, even though
it's a bit long winded compared to PHP.

Thanks for the feedback.

Chris
On May 14, 10:58 am, Marcus Bointon <[email protected]> wrote:
> On 14 May 2010, at 09:58, ChrisPols wrote:
>
> > and then ran a LEN on the results
>
> > Left(ggd2,Len(ggd2)-1)
>
> > Which removed the trailing comma as you suggested. So basically
> > exactly as you said.
>
> I'm not sure what language you're working in, but PHP has an "implode" 
> function I use for this. You give it an array of elements and a 'glue' 
> string, and it creates a string of all the array elements separated by the 
> glue string, like this:
>
> $a = array(1,2,3);
> echo implode(',', $a);
>
> "1,2,3"
>
> That's much simpler than post-processing the string.
>
> Marcus
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Chart API" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-chart-api?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to