Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array incrementation

Status
Not open for further replies.

uzzie123

Technical User
Mar 7, 2007
21
CA
Hi,

I created an array with a list of characters (T, U...). I want to create another array that displays the same characters minus the one character that was selected from the first array. How can I achieve this?

My second array is called "size"
 
When working with arrays, it is important to know a couple functions that will make your life a lot easier.

This list includes:

1. Array
2. Split
3. Join
4. Filter

Take a look at this code snippet.

Code:
<%
  Dim aDrives
  Dim Size
	
  aDrives = Array("T", "U", "V", "W", "X", "Y", "Z")
  [blue]Size = Filter(aDrives, [!]"X"[/!], False)[/blue]
	
  For i = lBound(Size) to uBound(Size)
    Response.write(Size(i) & "<br />")
  Next  
    
%>

Notice how the output does not include the "X" element of the array. Is this what you were looking for?

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Yes this is what I am looking for. But I drive letter I want to subtract must has to be selected by the user in the first list
 
Well... How do you know what item is selected from that first list? You haven't provided any details about that.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
What George has provided is server side code that you can use to check what has been done. You will have to first submit your form in order to then re-create your second list based on what was selected in the first form.

That, or else you will need to use client-side code to check for what the new value is in the first drop down list and then derive your second list from there. Either way, this question has been asked before in this forum and a search either here (or even in Google) should provide for you what you need.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top