Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


String usage within vbscript command line

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> String usage within vbscript command line
  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 >>
 String usage within vbscript command line - 9/29/2004 4:33:49 AM   
  maquaro

 

Posts: 1
Score: 0
Joined: 9/29/2004
From: USA
Status: offline
I'm trying to figure out the behavior of strings in vbscript with regards to Wscript on a command line using the cscript.exe command.

If I use:
< -start
Dim str1, str2, str3

Set str1 = "123"
Set str2 = "456"
Set str3 = str1 & str1

Wscript.Echo str3
-- end >

I get the error Microsoft VBScript runtime error: Object required: '[string: "123456"]'

What am I overlooking or missing? I have been to 30 tutorials and other areas that do not answer my questions about how a string can be dimmed, set, and displayed to the console window.

Thanks in advance
 
 
Post #: 1
 
 Re: String usage within vbscript command line - 9/29/2004 7:41:28 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
You don't need to use set when you are creating a string. So, instead of using set str1 = "123" you would use str1 = "123" Once you make that change it will work.

(in reply to maquaro)
 
 
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 >> String usage within vbscript command line 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