GetRows() & Arrays...

J

j1c

I have the following:

dim app_ids, irowloop, icolloop
app_ids = get_app_logins(session("stremail"))
for irowloop = 0 to ubound(app_ids, 2)
for icolloop = 0 to ubound(app_ids, 1)
response.write(app_ids(icolloop, irowloop) & ",")
next 'icolloop
response.write("|")
next 'irowloop

That returns:
0,0,bobsmith,pAssWord,|0,71,tom,tom,|0,71,tomf,pAssWord,|1,5,tom,a1,|
Is it possible to remove the final ',' before the '|' ??

Thanks!
 
B

Bob Barrows [MVP]

j1c said:
I have the following:

dim app_ids, irowloop, icolloop
app_ids = get_app_logins(session("stremail"))
for irowloop = 0 to ubound(app_ids, 2)
for icolloop = 0 to ubound(app_ids, 1)
response.write(app_ids(icolloop, irowloop) & ",")
next 'icolloop
response.write("|")
next 'irowloop

That returns:
0,0,bobsmith,pAssWord,|0,71,tom,tom,|0,71,tomf,pAssWord,|1,5,tom,a1,|
Is it possible to remove the final ',' before the '|' ??

Well, you could avoid writing it in the first place.


for irowloop = 0 to ubound(app_ids, 2)
for icolloop = 0 to ubound(app_ids, 1)
if icolloop = 0 then
response.write app_ids(icolloop, irowloop)
else
response.write ";" & app_ids(icolloop, irowloop)
end if
next 'icolloop
response.write("|")
next 'irowloop

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top