Parsing String Into An Integer
How can I make a variable to be an int instead of being a String?
I want to get it done in VBScript.
so if I have
id = "32"
how can I tell the browser to read that as a int instead of a string.
How can I make a variable to be an int instead of being a String?
I want to get it done in VBScript.
so if I have
id = "32"
how can I tell the browser to read that as a int instead of a string.
Is there a way of converting an integer to a string. so can 200 become "200".........i need to do this cuz i want to append it to another string.
View Replies View Relatedis any way possible to convert a string, which is a string of a number, to an integer (using VBScript). If not, are there any other solutions to have a number that is a string, and add one to increase that number?
View Replies View RelatedI get the EmpID from the form which is a variant. When I do the following, I get an overflow error. Can you suggest of a way I can convert this EmpID to a number?Code:
'Get the EmpID from the form
strEmpID = cInt(Request.Form("empid"))
VBScript is the scripting language I am using.
Lets say I have a string like "www.ssss.com/images/theimage.jpg"
I want to parse the string and just return the image: theimage.jpg
I have a string problem that I would like to resolve. I am submittting multiple values to a form that is posted to query string. The string looks like this:
http://localhost/csiapp/test.asp?Submit=Submit&menu2=436%A0AbdallahFadi&menu2=430%A0AdkinsAngela&menu2=425%A0AleemAmina
So what I need to do is to take the id number of the user and put it into an array so I can later insert it into the database. So for the example above, I need an list that looks like this:
436, 430, 425
Once I have this list I can make it an array and then put it into the database.
My question is how do I make the string above look like the string below? I know that I need to use some function of asp to parse the name oout of the string, but i just don't know exactly what....
I have a text file that I want to read and parse lines into seperate strings. For example...read in the text file below:
ARN0480633020025000
ARN0480680020388240
ARN0480686020030000
ARN0480770020030000
ARN0480792020050300
then parse the first 12 characters into strAccountNumber field then parse the remaining 7 characters in to strBalance.Ultimately, I want a user to enter an account# and it will lookup the account balance.
I need some help with parsing a string and returning all the urls in the string.
I posted a thread online a little while ago but the solution didn't work. Does anyone have any ideas? I have a string called "HTML" and i need a script to parse it for links. I'm fairly new to asp so any comments in the script you could give me.
/content/test.html/
/content/fred/test.html
/test.html/
I want to check the string for the last and second last / and I want the information between the two. in all of the above examples I want to end up with test.html, the string lengths will vary, could even be african lions on the prowl.html
If I had a string that look like this:
JOHNDOE|12,45,67,89|
EMILY|12,34,56|
SAWYER||
How do I parse the string in getting the names out first i.e JOHNDOE?
How do I then get the numbers out separately if they do exists? i.e. 12
45
I am thinking it is in a loop with instr or split function. I can see how I can get the numbers out first but with | and , at the same time - not sure.
Let's say that I have the string below:
<title>Partly Cloudy and 73 degrees F at Pitt-Greenville Airport, NC</title>
In an ASP file, how would I get the three characters before the word "degrees"? In this particular case, it would be "73 ". Obviously, I'm trying to extract the degrees from this weather string (which is from the National Weather Service, in case anyone is wondering). If anybody knows a better way to get the degrees information from this string.
EDIT: Nevermind. I found that the National Weather Service also offers an XML version that has the degrees totally separated. (The one above is from an RSS feed rather than straight XML.) Having it in this form makes it much easier to parse.
This is the output of a default-function of our CMS-system
<img title="certification-home page-main background.jpg" style="WIDTH: 550px; HEIGHT: 175px" height="175" alt="certification-home page-main background.jpg"></img><a href="/en/certification/placementexam/default.asp" tcmuri="tcm:18-442"><IMG tcmuri="tcm:18-425" SRC="/en/Images/certification-page-header_tcm18-425.jpg" align="right" width="550" height="175"/></a>
Now I want to read out only this value: /en/Images/certification-page-header_tcm18-425.jpg. Any ideas how to do it?
I need to parse a long string into no more than 30 character chunks, but I also need to leave the words intact. Right now, I am using:
For intStart = 1 to Len(strOriginal) by 30
strPrint = Mid$(strOriginal, intStart, 30)
Print #detailFile, Tab(1), intStart, Tab(4), strPrint
Next intStart
and it's fine, but splits up some of the words. If I could figure out how to find the preceding space of the 30 limit, I'd be in good shape.
I'm adding fields to a table with this code:
sql = "ALTER TABLE companies ADD COLUMN fieldname int"
now "int" gives the number as a whole number but what is the syntax for this value to be allowed to involve decimals?
If i need to search the ticketnumber by using long integer, do i need to include the single quote like the example below.
strsql="Update offsitetape set status='Open' where ticketnumber =' "&problemopen&"' "
When I get the value from the textfield, do I need to convert it to integer or just leave it like that:
problemopen=request.form("tapestextfield")
I am trying to send a 'single' data type to a sql server db cell that is formatted for 'decimal' from asp/ado code and it is converting it to an integer. Should I be using some other data type in sql server?
View Replies View Relatedwhen i set the checkScore1 to 100 or higher in the table field, the if else condition became FALSE? But it work for 70 to 99 ??
If checkMaxAttempt = "2" AND checkScore1 >= "70" Then
response.redirect "error.asp"
'last attempt check
ElseIf checkMaxAttempt <= "1" AND checkScore2 >= "70" Then
response.redirect "error.asp"
ElseIf checkMaxAttempt <= "0" Then
response.redirect "error.asp"
Else 'do nothing
End If
I am trying to reiterate through a for..next..loop using an integer (i). I would like to know when it is either a odd or an even number, insteading of using the simple version below:
if i = 1 or i=3 or i = 5 then
Response.Write "<tr " & strRowOdd & ">" & vbcrlf
else
Response.Write "<tr>" & vbcrlf
end if
Want to format table rows in a different style.
Any ideas?
I have a set of values like name,age,desg,salary,year etc . currently i am getting the values using max(year) and displaying the values year is integer in my sqlserver db
If you go thru my code (see attachment) you would be able to understand.
Now the problem is if a person gets promoted or hike in his salary i have to display two differnt salary on the same year how do i do that. currently i am displaying the values based on the max(year) max(year)-1 etc. i cannot modify the database. i have to do some changes on my coding only. Please view my coding as attachment (3000.txt).
For example
Name Age Desig Salary Year
abc 35 CEO 39000 2004
abc 35 CFO 38000 2003
abc 35 CTO 37000 2002
abc 35 CTO 35000 2001
abc 35 Direcotr30000 2001
How do i display this from the database.
I have a set of values like name,age,desg,salary,year etc
currently i am getting the values using max(year) and displaying the values year is integer in my sqlserver db If you go thru my code (see attachment) you would be able to understand.
Now the problem is if a person gets promoted or hike in his salary i have to display two differnt salary on the same year how do i do that. currently i am displaying the values based on the max(year) max(year)-1 etc. i cannot modify the database. i have to do some changes on my coding only. Code:
we have a recordset return by a stored procedure from MS SQL. basically this recordset is an integer value, but when we are checking is value something strange happens :
if RS(0) = -1 then
...
end
for example RS(0)=46 and anyway our program runs what is inside the if ...end structure..
how can we cast -1 to integer... something like in C++ : (int)(-1).... in order to make sure that -1 in integer.
I am calling a javascript function in my asp. I am passing a recordset value, a 7 digit integer, to this javascript function. However, in the function this value is not coming in correctly. say for example i am passing 0360001, in the function when i pass it to another window, its going as 122881.
I am asuming its because of the size of the default integer data type. If you think thats the reason, how can set a long integer data type to this value, if that can be done in asp.
What is the function in ASP to see if an object / string is an integer?
I want to check the contents of a form, and if it's an integer, i.e a number, do something, else if it's a word do something else, and I'm not sure howto?
I have a form, that has a drop down menu with number of options eb. home, work, mobile etc. However when the choice is added to the database table it appears as a number inside the table, even though the field in the table is set to a text value (it is an MS Access DB) Why is this?
View Replies View RelatedI am trying to test a users input to be an integer. Is there a simple function that i can use. Here is a simplified version of my attempt.
dim numTestNumber
numTestNumber = 6
if isNumeric(numTestNumber) = false then
Response.Write "The input must be numeric"
Response.End
end if
if Cint(numTestNumber) then
Response.Write "The Number is an Integer"
else
Response.Write "The Number is not an integer"
end if
I am looking at doing a rotating image using the date to count it up. I have found a small bit of script to do it but have to admit Code:
View Replies View RelatedI am trying to update an integer field in an Access database with a null value (ie, make the field empty). It currently has an integer in it. Here's the code I've tried, which normally works for all other updates:
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = sConnString
rs.Source = "SELECT * FROM tblFixtures WHERE FixtureID = " & strFixtureIDcurrent
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
rs("ArticleID") = ""
rs("Result") = ""
rs.update
rs.close
set rs = nothing
However I am getting a Type Mismatch error on the rs("ArticleID") = "" line. Where have I gone wrong?
Database: Access 2000
How does one switch a converted currency format back to a plain integer in
Asp. I have tried Cint but this produces an overflow error for the
following:
NewPrice = CInt(Request.Form.Item("NewPrice"))
Microsoft VBScript runtime (0x800A0006)
Overflow: 'Cint'
I have a form with several fields that are updated to a DB as an integer. I am using this code to validate the fields:
iincidentdet = CInt(iincidentdet)
If Err.number <> 0 Then
strErrorMsg = strErrorMsg & "Your entry for integer_field could " & _
"not be converted to an integer! Remember that integers " & _
"need to be from -32,768 to 32,767.<br />" & vbCrLf
Err.Clear
End If
when I use my tab to pass by one of the integer fields which should be a 'zero' or null. Is there a way to default the fields to a null value?
How to do the error handling if the users key in character into integer text field? If possible, please give example and show me the coding.
View Replies View Relatedi want to ask is there any way that i could get the value from field (the value will be used in SQL statement) without submit the form coz if i use Request.form("name"), it need to submit the form to get the value
View Replies View RelatedI'm interested in creating an asp function that enables the general parsing of xml. The function needs to take into account the structure of the xml document, as the document(s) can be quite complex.
The use of getElementsByTagName() is not appropriate in this case as I'm trying to avoid picking up the wrong data. The function also needs to be able to test if a node has any attributes and what the attributes are. Here's an example of the document I'm trying to parse: Code:
ASP
I have
value(0) = 1
value(1) = 2
value(2) = 3
value(3) = 4
etc...
I need to have as output
1,2,3,4 ...
Finnaly I must submit that to 2nd asp page, and use it inside the javascript. Any ideas?