Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions
This is the forum to discuss the Wrox book VBScript Programmer's Reference, 3rd Edition by Adrian Kingsley-Hughes, Kathie Kingsley-Hughes, Daniel Read; ISBN: 9780470168080
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 29th, 2005, 10:52 AM
Registered User
 
Join Date: Dec 2005
Location: Wheeling, IL, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Running Under Command Prompt

When I execute a .vbs file it always executes via the command prompt.

Is there a way to stop/modify this behavior?

Running XP Pro - Service Pak 2

Thanks,
Bill Slaughter
__________________
Bill Slaughter
Reply With Quote
  #2 (permalink)  
Old December 30th, 2005, 02:30 PM
Registered User
 
Join Date: Dec 2005
Location: Wheeling, IL, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For Example:

The below script will not display the err in a windows dialog.

It is displayed in the command box and is only seen if I execute it from the command prompt.††

If I click on the file name in windows explorer the command prompt box appears and disappears so quick that the result is lost.


Option Explicit

Dim x, y

x = InputBox("Please enter a number to divide into 100.")
If x <> 0 Then
    y = 100 / x
    MsgBox "100 divided by " & x & " is " & y & "."
Else
    Err.Raise vbObjectError + 15000, _
        "ERR_MSG_UGLY.VBS", _
        "Hey, stupid, you can't enter a zero. It will " & _
        "cause a divide by zero error."
End If

Why doesn't the windows dialog box appear as shown in the book?

Thanks.



Bill Slaughter
Reply With Quote
  #3 (permalink)  
Old May 5th, 2009, 04:09 PM
Authorized User
Points: 126, Level: 2
Points: 126, Level: 2 Points: 126, Level: 2 Points: 126, Level: 2
Activity: 30%
Activity: 30% Activity: 30% Activity: 30%
 
Join Date: Apr 2009
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am new to VBScript Programming; thus, I am unfamiliar with VBScript Error Objects.

However, I think that you probably should use a MsgBox for your Error Message.

EXAMPLE:

Code:
 MsgBox Err.Raise vbObjectError + 15000, _
"ERR_MSG_UGLY.VBS", _
"Hey, stupid, you can't enter a zero. It will " & _
"cause a divide by zero error."
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
command prompt karthisena BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 27th, 2007 03:11 AM
Command Prompt karthisena General .NET 2 January 25th, 2007 11:29 AM
Command Prompt joconnor PHP How-To 1 August 11th, 2004 06:29 AM
compiling from command prompt shakeelw BOOK: Professional C#, 2nd and 3rd Editions 2 July 13th, 2004 07:38 PM
VS.NET Command Prompt organicglenn BOOK: ASP.NET Website Programming Problem-Design-Solution 1 April 1st, 2004 01:39 AM



All times are GMT -4. The time now is 03:50 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.