Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


help

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,47834
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> help
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 help - 6/1/2007 3:34:02 AM   
  Rany

 

Posts: 1
Score: 0
Joined: 6/1/2007
Status: offline
Original message moved by dm_4ever
Reason : Moving To Appropriate Forum
hello all

   set R2 = database.Execute("select number,msgl,msgr from lovemeter")
  
   do while not R2.EOF
Dim l(20), r(20), testl, testr As String
Dim length_l, lenght_r, valueleft, valueright, value, a, b As Integer

       valueleft = 0
valueright = 0
a = 1
b = 1
msg_l  = R2("msgl")
msg_r  = R2("msgr")
length = len(msg)
length_l = len(msg_l)
lenght_r = len(msg_r)

do
l(a) = Mid(msg_l,a,1) 
valueleft = Asc(l(a)) + valueleft
a = a + 1
loop until a = lenght_l + 1
do
r(b) = Mid(msg_r,b,1)
valueright = Asc(r(b)) + valueright
b = b + 1
loop until b = length_r + 1

i cant seem to understand why i the function asc is not recognised
what i need is to convert the string to ASCII

please help...
 
 
Post #: 1
 
 RE: help - 6/1/2007 4:43:34 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
What you posted is VB, not VBScript.
In VBScript, the Asc() function returns the ANSi code for the first letter of the string passed to it.
IE.
Asc("Test")
would return the same as
Asc("T")

Also, your Dim statements will return errors, as in VBScript all variables are type Variant, and cannotn be Dim'med as a particular type.


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Rany)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> help Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts