Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Not used to ASP

Reply
Thread Tools

Not used to ASP

 
 
Sonnich Jensen
Guest
Posts: n/a
 
      09-13-2007
Hi all!

I am usually working with PHP, rarely with ASP. I have a book for
help, but that does not do much for me.

I have an array, like:

redim Preserve ecode(I+1)
ecode(I) = field_value(0, rsItem)

it adds stuff to the array.

Now, I need to _insert_ items into the array.
In other words, I need to find an item, say "code C" in the array, and
then insert "code C-1" right after it.

I know very well how to do this in PHP, but I dont even know where to
look for help for ASP.

Would anyone be so kind to help me out?

BR
Sonnich

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-13-2007
Sonnich Jensen wrote:
> Hi all!
>
> I am usually working with PHP, rarely with ASP. I have a book for
> help, but that does not do much for me.
>
> I have an array, like:
>
> redim Preserve ecode(I+1)
> ecode(I) = field_value(0, rsItem)
>
> it adds stuff to the array.
>
> Now, I need to _insert_ items into the array.
> In other words, I need to find an item, say "code C" in the array, and
> then insert "code C-1" right after it.
>
> I know very well how to do this in PHP, but I dont even know where to
> look for help for ASP.
>
> Would anyone be so kind to help me out?
>

First of all, the language you are using is vbscript, not ASP. ASP is a
"platform" which supports multiple scripting languages, including
vbscript and jscript.
You can download the Windows Scripting Host (which includes vbscript)
documentation from here:
http://www.microsoft.com/downloads/d...DisplayLang=en
Vbscript does not support inserting elements into the middle of an
array.
If you are tied to using a vbscript array, you have two options:
1. Create a new array and write the array elements in the order you want
them
2. Resize the array, use a loop to move the array element values to the
desired location and set the desired element value to the value you wish
to insert.

This task is a little simpler with an ad hoc ADO recordset: AddNew still
adds records to the end of the recordset, but you can use Sort to order
them in any order you want.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am buying all of the below Cisco equipment USED OR NEW. NOTE someline items say new or used, but I will buy them in both conditions. network buyer VOIP 0 12-23-2010 01:26 AM
Can Groovy be used in an applet and/or can it generate the Java bytecodes that then can be used in an applet? Casey Hawthorne Java 1 03-18-2009 12:56 AM
Is there a perl package, or data in a form easily used by a perlscript, that can be used to determine when to change to or from daylightsavings time? Ted Byers Perl Misc 23 11-15-2008 05:53 PM
Unreadable file on Canon S 400.I used a I used a Joseph Miller Digital Photography 3 01-13-2004 09:40 PM
Secure web services used by ASP & ASP.NET Dave ASP .Net Web Services 0 10-22-2003 06:53 PM



Advertisments