hilman008 Publish time 16-8-2012 11:08 PM

VBScript Tutorial [Full Tutorial]

Kepada geng-geng program , benda ini mungkin menarik bagi anda...
( kalau salah tempat , mod sila move ke tempat yang sesuai dgn thread ni )
VBScript hanya untuk Windows saja. Yang guna OS lain tu , pergi blah (gurau je)
VBScript sesuai digunakan untuk message box dan lain-lain..
Dulu ia digunakan oleh Microsoft untuk Internet Explorer dan sekarang ia masih digunakan.

Requirements:
a. Notepad
b. Internet Explorer.*
*Note: You can use other browser but not all browser supports VBScript
c. Time
d. A brain

Step 1:
Open Notepad
Start > All Programs > Accessories > Notepad

http://cdn.instructables.com/F6R/50KJ/GJHVD7PT/F6R50KJGJHVD7PT.LARGE.jpg

Type in msgbox("Hi",0+64,"Computer")

Step 2:
http://cdn.instructables.com/FHN/HTJZ/GMX1SSPM/FHNHTJZGMX1SSPM.LARGE.jpg
Now , save this file by clicking
Save As > Then type name.vbs

Example : test.vbs



Step 3:

http://cdn.instructables.com/F7B/8NQE/GKS0TKWJ/F7B8NQEGKS0TKWJ.LARGE.jpg
This makes an error message how you like it.

msgbox ("Message goes here",0+16,"Title goes here")

if the user is supposed to make a decision the variable can be added like this.

variable=msgbox ("Message goes here",0+16,"Title goes here")

The numbers in the middle vary what the messge box looks like.
Here is the list

0 - ok button only
1 - ok and cancel
2 - abort, retry and ignore
3 - yes no and cancel
4 - yes and no
5 - retry and cancel
TO CHANGE THE SYMBOL (RIGHT NUMBER)
16 - critical message icon
32 - warning icon
48 - warning message
64 - info message
DEFAULT BUTTON
0 = vbDefaultButton1 - First button is default
256 = vbDefaultButton2 - Second button is default
512 = vbDefaultButton3 - Third button is default
768 = vbDefaultButton4 - Fourth button is default
SYSTEM MODAL
4096 = System modal, alert will be on top of all aplications

Note: There are some extra numbers. You just have to add them to the numbers already there like

msgbox ("Hello World", 0+16+0+4096)





Pages: [1]
View full version: VBScript Tutorial [Full Tutorial]


ADVERTISEMENT