请教各位前辈VBscript五大问题!

ldxm8848 2004-09-10 04:03:16
各位高手:
您们好!
我初学VBscript,有很多疑问的问题想请教下各位前辈。还望各位前辈可以耐心详细为我解答。五大问题如下:
1、请问网站设计用哪个脚本语言好?是VBscript还是Javascript?它们两个哪个功能强大?
2、请问为什么用VB定义变量的格式在VBscript中定义变量类型时,出现错误?难道VBscript定义变量类型的格式和VB不同吗?那么VBscript中又应该如何定义变量类型呢?例如:定义一个日期型的变量,该怎么定义?
3、如何去掉用VBscript弹出的消息/提示框或对话框的标题栏上自动加上的“VBscript”字符串呢?
4、如何用VBscript实现当单击一个按钮时,在新窗口打开指定的页面?
5、有哪位知道哪有VBscript的比较好的,完整的免费教程下载吗?
期待您的回复!
Thank you very much!
...全文
282 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
clin2y 2004-11-05
  • 打赏
  • 举报
回复
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/script56/html/vbscripttoc.htm
以上是vs2003中vbscript语言的教程
jam021 2004-09-14
  • 打赏
  • 举报
回复
哈,tech兄来了,支持tech兄的!严重同意tech兄!
fxingwei0000 2004-09-14
  • 打赏
  • 举报
回复
1,据说JSP比较好
2,一样,可能是你写错了,
Dim data as Data
3,以上有回复
4,在单击事件中加入:
Load UserForm
UserForm.Show vbModeless
DoEvents

techgopher 2004-09-13
  • 打赏
  • 举报
回复
问题3恐怕用VBScript的msgbox函数更合适,指定title参数就可以了。以下是该函数的有关说明:

Microsoft® Visual Basic® Scripting Edition
MsgBox Function Language Reference
Version 1


See Also


--------------------------------------------------------------------------------

Description
Displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked.
Syntax
MsgBox(prompt[, buttons][, title][, helpfile, context])
The MsgBox function syntax has these arguments:

Part Description
prompt String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13) & Chr(10)) between each line.
buttons Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. See Settings section for values. If omitted, the default value for buttons is 0.
title String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.
helpfile String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If helpfile is provided, context must also be provided. Not available on 16-bit platforms.
context Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic. If context is provided, helpfile must also be provided. Not available on 16-bit platforms.


Settings
The buttons argument settings are:
Constant Value Description
vbOKOnly 0 Display OK button only.
vbOKCancel 1 Display OK and Cancel buttons.
vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
vbYesNo 4 Display Yes and No buttons.
vbRetryCancel 5 Display Retry and Cancel buttons.
vbCritical 16 Display Critical Message icon.
vbQuestion 32 Display Warning Query icon.
vbExclamation 48 Display Warning Message icon.
vbInformation 64 Display Information Message icon.
vbDefaultButton1 0 First button is default.
vbDefaultButton2 256 Second button is default.
vbDefaultButton3 512 Third button is default.
vbDefaultButton4 768 Fourth button is default.
vbApplicationModal 0 Application modal; the user must respond to the message box before continuing work in the current application.
vbSystemModal 4096 System modal; all applications are suspended until the user responds to the message box.


The first group of values (0–5) describes the number and type of buttons displayed in the dialog box; the second group (16, 32, 48, 64) describes the icon style; the third group (0, 256, 512, 768) determines which button is the default; and the fourth group (0, 4096) determines the modality of the message box. When adding numbers to create a final value for the argument buttons, use only one number from each group.

Return Values
The MsgBox function has the following return values:
Constant Value Button
vbOK 1 OK
vbCancel 2 Cancel
vbAbort 3 Abort
vbRetry 4 Retry
vbIgnore 5 Ignore
vbYes 6 Yes
vbNo 7 No


Remarks
When both helpfile and context are provided, the user can press F1 to view the Help topic corresponding to the context.
If the dialog box displays a Cancel button, pressing the ESC key has the same effect as clicking Cancel. If the dialog box contains a Help button, context-sensitive Help is provided for the dialog box. However, no value is returned until one of the other buttons is clicked.

When the MsgBox function is used with Microsoft Internet Explorer, the title of any dialog presented always contains "VBScript:" to differentiate it from standard system dialogs.

The following example uses the MsgBox function to display a message box and return a value describing which button was clicked:

Dim MyVar
MyVar = MsgBox ("Hello World!", 65, "MsgBox Example") ' MyVar contains either 1 or 2,
' depending on which button is
' clicked.

flyingscv 2004-09-13
  • 打赏
  • 举报
回复
4 <HTML>
<HEAD>

<SCRIPT ID=clientEventHandlersJS LANGUAGE=vbscript>
<!--

function button1_onclick()
window.open "default.htm"
end function
//-->
</SCRIPT>
</HEAD>
<BODY>

<P> </P>

</BODY>
</HTML>
<INPUT type="button" value="Button" id=button1 name=button1>

5 msdn比较好吧,全

晕,顺序错了

flyingscv 2004-09-13
  • 打赏
  • 举报
回复
1 一般认为jscript客户端好,vbscript服务端好,喜欢的话都用vbscript好了
2 3 回复人: jam021(jam) ( ) 信誉:105
4 <HTML>
<HEAD>

<SCRIPT ID=clientEventHandlersJS LANGUAGE=vbscript>
<!--

function button1_onclick()
window.open "default.htm"
5 msdn比较好吧,全 :)
end function
//-->
</SCRIPT>
</HEAD>
<BODY>

<P> </P>

</BODY>
</HTML>
<INPUT type="button" value="Button" id=button1 name=button1>
jam021 2004-09-13
  • 打赏
  • 举报
回复
2、请问为什么用VB定义变量的格式在VBscript中定义变量类型时,出现错误?难道VBscript定义变量类型的格式和VB不同吗?那么VBscript中又应该如何定义变量类型呢?例如:定义一个日期型的变量,该怎么定义?

在VB Script中,定义变量的时候只有一种类型:variant型,所以定义的时候只能是Dim aa 后面不能加东西

3、如何去掉用VBscript弹出的消息/提示框或对话框的标题栏上自动加上的“VBscript”字符串呢?

WScript.Echo "asd"
ldxm8848 2004-09-10
  • 打赏
  • 举报
回复
可怜啊,上面的五大问题还未能解决!!!
starsoulxp 2004-09-10
  • 打赏
  • 举报
回复
各有长处,JAVASCRIPT可以实现很多特效

要教程,跟我联系。starsoulxp@eyou.com

2,506

社区成员

发帖
与我相关
我的任务
社区描述
VBA(Visual Basic for Applications)是Visual Basic的一种宏语言,是在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。
社区管理员
  • VBA
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧