Getting Values From Array

for i = 2 to NOD
newdate = DateAdd("d", 1, newdate)
strdate = strdate & newdate & ", "
next
MyArray = split(strdate, ", ")

I have the above code written in one of my asp pages, the date array is splitted, but how do I get the first and last date assign to a variable.....

int min = MyArray(MyArray.Length-1)
int max = MyArray(0)

I got this code from the web, however it gives me an error:

Code:

Microsoft VBScript runtime error '800a01a8'
Object required: 'MyArray'

View Replies


ADVERTISEMENT

Entering Values From Array

i have my database in MS Access. a table name products contains fields:

pro_name
no_of_comp

inserting data from form where products field is mutiline text box. split this and store in array then insert records.

now i want to facilitate let user edit their data.

during editing new products are entered with no_of_comp = 1 and already exisiting products gets no_of_comp= no_of_comp + 1.

if user delete product then no_of_company = no_of_comp - 1.

what i want to do is: Code:

View Replies View Related

Remove Values In Array

How can I remove a value from an array. Like: remove from array where value=bla-bla?

View Replies View Related

Writing Out Array Values

I have an array which has days of the month stored in it. For example at one
time it might have the values

1,2,3,6,7,8,9

at another time it might have the value

4,5,12,14,19,25

These are days of the month that have been selected and read into an array.
What i would like to do is to write them out and put a "X" where the days
were selected Code:

View Replies View Related

Spliting An Array And Using Its Values

i m getting these value from a query n stored it in an array:

FY2005 P1 (8/1/2005 - 8/31/2005),
FY2005 P2 (9/1/2005 - 9/31/2005) and so on.
i need to use eg
8/1/2005 as startdate and 8/31/2005 as enddate
similarly
9/1/2005 as startdate and ,9/31/2005 as enddate.
and so on

we can split FY2005 P1 (8/1/2005 - 8/31/2005),
FY2005 P2 (9/1/2005 - 9/31/2005) by using split func in vbscript. But how can we use its subparts.i mean 8/1/2005 etc ...

View Replies View Related

Sorting Values In An Array

some ready-made code that will loop through the values in an array and sort them in ascending or descending order? I'm about to start building some new functionality that will need to sort the values in an array and then present them in ascending order. My initial thoughts are to loop through the initial array, find the lowest value and then load that value (and all associated values) into a new array.

View Replies View Related

ASP Multidimensional Array Values

I am wondering if its possible to load two array ad use one as item title and the other as value, ex:

array1 = "Sally, Jason, Jackson, Marie"
array2 = "24, 54, 21, 33"

For ....

TempSally(Sally) = 24
TempJason(Jason) = 54
....

Next....

View Replies View Related

Comparing Count To Array Values

I have the following code to check if a field number matches a specific value. here is the code:

View Replies View Related

How Can I Transfer Values From An Array To A Select Box?

I first retrieve the values stored in a session variable (where I have stored an array). Then I assign the session variable to a local array called "myarray".

Assume that "myarray" now contains 5 records. What would the code look like if I want to create a loop that transfers the 5 values from "myarray" into a select box/dropdown list?

How is that done?

View Replies View Related

Rediming An Array With Non Selected Values

I have 24 checkboxes all with the same naming convention, each box has a
value ranging from 1 to 23, what I need to do is fill in the gaps with a
0 value where the user doesn't select a value.

So lets say that the user selects:

1,2,3,4,5,6,7,15,18,19,20

what I want to do is use the split function on the next page to convert
into an array but then I want to redim the array and fill in the missing
values, so I would end up with:

1,2,3,4,5,6,7,0,0,0,0,0,0,0,15,0,0,18,19,20,0,0,0

is it possible to do this and if so how?

View Replies View Related

Session Variables Store Array Of Values?

I know that cookies can store an array of values, which can be accessed like this:

tempid = Request("cookiename")(i)

Is it possible to use session variables in the same way? Store a array of values in the same session variable and access them on another page by indexing?

I've looked around alot and I've not found anything suggesting that this is possible.

Right now I'm using a single set of cookies to store info on a series of purchaces of the same type of item. I'm hoping to use session variables to replace the cookies.

Does anyone know for certain if this is not possible?

View Replies View Related

Bubble-sort Routine Changing Array Values

I have part of a keyword search function that is acting supernatural - I have a bubble-sort function that sorts the content of an array, then returns an array containing the item numbers of the original array, arranged in order according to their content. Code:

View Replies View Related

Asp: Pass Array Element Values To Form On Next Page

how to create an array of checkboxes that were selected from a form on one page and pass them into hidden fields in a form on the next page? I have this massive project I've been working on and am having trouble with this.

View Replies View Related

Problem Filtering Recordset By Values Held In Array

I am trying to filter a table of users to select only those records
whose roleID matches a value in an array. There could be any number of
IDs held in the array from one to a few hundred. The array is
generated by splitting a comma delimited memo field from a second
table in an Access DB. I can split the memo field OK, I can
response.write its values, but what I now want to do is add a value
from another table to my reponse write loop. Code:

View Replies View Related

Matching Array Index To Values Retrieved From Database

I have this dynamic array(shown below) that I need to match to values (1 - 10) that I am returning from the database via DSN connection object.

The values I need to match are on the same page (in their own table) but I am not sure how to match up the array indexes to these values. I want to be able to display the array result as part of or nested in another table. Code:

View Replies View Related

How Do I Retrieve Values Of An Array Variable From A Form To An Asp Page?

if i have a vbscript function on a certain form and I assigned some values on an array variable on that function, is there a way for me to retrieve the values of that array on another asp page once i submitted the form?

View Replies View Related

Rebuilding Of An Array From An Existing Array

I dump the entire recordset into an array:

If not rs.EOF Then
aEmp = rs.GetRows()

Contents of the array are in this order:

EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName

This query sort on the basis of Lft and Rgt columns.

The name of the array is: aEmp.

My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.

Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.

View Replies View Related

Array Integers Vs Array Variables

In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.

Ex.

Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works

Code:

View Replies View Related

Form Values With A File - Passing Values

I want to call a recordset so you can edit the details and then obviously pass the parameters onwards into the db. However, the user guide just says this:

To process other fields in the form, use the Form collection of the upload object the same way you would use the Form collection of the Request object. For example, if your form had a text element named UserName, your processing code would include: Code:

View Replies View Related

How To Convert Escape Values In To Actual Values

i need to convert the escape values which are by mistake updated in DB.
example:

this is a sample text string
is updated in DB as
this%20is%20a%20sample%20text%20string

here %20 is the space.

like wise there are many entries for :,'

is there way that i can update all this in a update statement?
or use asp to to update the records?

View Replies View Related

How To Extract Indiviual Values From A Set Of Values

I have a variable SET which has the value Of 1, 2, 3, .., N.

SET=val1, val2, val3, val4, ..., valN

What is the commend or procedure to extract individual values, val1, val2, ...

View Replies View Related

Create A New Array From An Array

I want to create a new array called arrNames2 and copy contents of arrNames to arrNames2.

I then want to loop through my db and add more names (while going through the loop) to arrNames2. What is the best way to do this? Do I have to keep redim the array wehn I add more names?

View Replies View Related

Array In Sql

i want to excute given logic

select * from Product_Table where Product_Code in

ARRAY

i.e i want to select Product_Code from VB array and not from a query
is it possible.

View Replies View Related

Array

I know I can do this programatically using a loop but I thought there might be
some easier or more effective way.

I am trying to invert an array.

i.e.

array1 = 1,2,3,4,5

but I want to get

array2 = 5,4,3,2,1

Is there something like array2 = invert(array1)?

View Replies View Related

Array

I have to following code:Code:

dim arrRes(9),getal,som
arrRes=Array(4,4,4,4,4,5,5,5,5,5)
for getal=0 to 9
som=som+arrRes(getal)
next
response.write("Het klasgemiddelde is " &som/10)

I get a type not match error on the second line

View Replies View Related

ASP Array?

I have a page in my admin system where the user can edit products they
have added. The problem I am having is with Related Products. These are
all listed in a multiple list. What I need to do is have those selected
when the product was added, already be highlighted in the multiple list
on the product edit page. Here is my post from another forum.

Code:

View Replies View Related

Array

For some reason, when I try to run the following array, I'm getting an
error:

dim cat(0)

cat(0)="0407"
cat(1)="0102"

'I will be adding more to this array, but just trying with two for
starts.

for counter = 0 to 1

itno=cat(counter)

'I get an error when it runs through this function

Function rightvar(theVar,lengthNeeded)
Dim sResult
sResult=theVar
if Len(theVar)< lengthNeeded then sResult= String(lengthNeeded -
Len(theVar)," ")& theVar
rightvar=sResult
End Function

Can someone help me understand why?

View Replies View Related

Array

The problem is that in my 5 years of programming in various languages i have never really understood arrays (DUMB @$${lol})
What i want to do is offer an advanced search of a database table on my website. I currently offer the functionality so that the whole of the database can be viewed within the web page so that it doesn't need to be downloaded/need access to view it.
What i need to do is run a script that takes all of the column headings that i have and put them into an array. Then with the array i need to output each element into a drop down box.

View Replies View Related

Asp Array

Ok what I have is a little script which runs through my stock compares how many of one item we have compared to what we need and displays the out come.

What id like to do is make an array with the item name so lets say If how many is needed is greater then 0 then add the name of that consumable to an array and move on until the end.

Then I want to use the arry to display each consumable on an order form. Anyone have any idea how to do this in ASP or can give me any advice on a better way to do it?

View Replies View Related

Array

I am doing the following:
Code:

dim n
n=4'ubound(arrsequences)
response.write "n:" & n
dim arrproductNames(n)
dim arrproductSeq(n)

and getting the following error:
Microsoft VBScript compilation error '800a0402'
Expected integer constant
process.asp, line 33
dim arrproductNames(n)

View Replies View Related

Add Something To An Array

How can I add something to an array, e.g
[VBS]
Dim MyArray

MyArray = Array("Item 1", "Item 2", "Item 3")

'Do some code here

'I now want to add another item to my array, how?
[/VBS]

View Replies View Related

An Array

Is there a way of determining whether or not a value or values are present in an array.
Is there something nice and easy as with php's

if(in_array($SomeValue,$myArray)){
echo "The value is here";
}
else{
echo "The value is not here";

View Replies View Related

ASP Array

how to store request multiple value(Select box) in an array.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved