[thelist] asp array into variables

dn at dittodesign.co.uk dn at dittodesign.co.uk
Wed Aug 13 14:29:35 CDT 2003


Cheers Paul, sorry about the late response I had to go
out and its been one thing after another while I've been out.

>What are you doing with these variables?

I have a db with a 'show on front page' field checkbox for product
images. I can't use a repeat region on the page because the
images are staggered across the page.

So I was putting the info from the recordset into an array an then
trying to turn that into seperate variables to place where ever I
choose on the page.

Is there a neater way to do this maybe bypass the array
and place the recordset directly into variables?

Anyway your little bit of tweaking has cracked it thanks ;-)
and that'll do me.

regards,

Darren Yates
dn at dittodesign.co.uk
http://dittodesign.co.uk


----- Original Message -----
From: "Paul Cowan" <evolt at funkwit.com>
To: <thelist at lists.evolt.org>
Sent: Wednesday, August 13, 2003 12:02 PM
Subject: Re: [thelist] asp array into variables


>
> Darren wrote:
> > Results in an error -
> > Subscript out of range: '[number: 1]'
>
> This is failing because when you do the GetRows, you're getting
> out an array with only 1 'column', if you like, and any number
> of rows.
>
> When you do this:
> >   ImgSrc1 = tbValues(1, i)
>
> You're saying 'the second column (index 1) of row i'. Row i (initially
> 0, the first row) doesn't HAVE a second column... just the one.
>
> This would be more likely to be what you're after, I think:
>   ImgSrc = tbValues(0, 0)
>   ImgSrc1 = tbValues(0, 1)
>   ImgSrc2 = tbValues(0, 2)
>   ImgSrc3 = tbValues(0, 3)
>   ImgSrc4 = tbValues(0, 4)
> (without the for loop)
>
> In which case 'ImgSrc' will contain the value of the "Image" field from
> the first row, ImgSrc1 from the second, and so on.
>
> This will crap out if you've got less than 5 rows in your recordset,
though,
> and won't expand if you've got more than 5. I'm don't know that this is,
> in fact, what you're trying to do.
>
> What are you doing with these variables? I'm not 100% sure that what
> you're doing is the best way to do it, whatever it is. :)
>
> Cheers,
>
> Paul
>
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list