How to get elements in Array to converto to numeric?
From: Mike Ouimet (mike_ouimet_at_premierinc.com)
Date: 12/21/04
- Next message: Larry: "Re: Multiple-step_operation_generated_errors._Check_each_status_va"
- Previous message: Bob Barrows [MVP]: "Re: Multiple-step_operation_generated_errors._Check_each_status_va"
- Next in thread: McKirahan: "Re: How to get elements in Array to converto to numeric?"
- Reply: McKirahan: "Re: How to get elements in Array to converto to numeric?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Dec 2004 12:09:04 -0800
In the sample code below I am trying to add arrNum(i) with arrNum(j) but
they keep concatenating instead. Any clues what I am doing wrong here? I
have tried to change the data type but have had little luck. Thanks.
<html>
<head>
<script language = "vbscript">
Sub cmdUserInfo_OnClick()
arrDesc = Array(form.txtName1.value,form.txtName2.value)
arrNum = Array(form.txtNumber1.value,form.txtNumber2.value)
For k = 0 To UBound(arrDesc)
For l = k+1 To UBound(arrDesc)
For i = 0 To UBound(arrNum)
For j = i+1 To UBound(arrNum)
document.write arrDesc(k) + " & " & arrDesc(l) & " = " & arrNum(i) +
arrNum(j)
Next
Next
Next
Next
End Sub
</script>
</head>
<BODY>
<form name = "form" method = "post">
<table border="1">
<tr>
<td>Tire Desc:</td><td><input type = "text"name = "txtName1"></td>
<td>Spring Rate:</td><td><input type = "text"name =
"txtNumber1"size="2"></td>
</tr>
<tr>
<td>Tire Desc:</td><td><input type = "text"name = "txtName2"></td>
<td>Spring Rate:</td><td><input type = "text"name =
"txtNumber2"size="2"></td>
</tr>
<tr>
<td><input type = "button" name = "cmdUserInfo" value = "Summit"></td>
</tr>
</table>
</form>
</body>
</html>
Michael Ouimet
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Larry: "Re: Multiple-step_operation_generated_errors._Check_each_status_va"
- Previous message: Bob Barrows [MVP]: "Re: Multiple-step_operation_generated_errors._Check_each_status_va"
- Next in thread: McKirahan: "Re: How to get elements in Array to converto to numeric?"
- Reply: McKirahan: "Re: How to get elements in Array to converto to numeric?"
- Messages sorted by: [ date ] [ thread ]