You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An implemantation of the LZW algorithm. It uses 2 bytes per code, variable length codes are out of question in VBS, as those would require lots of integer division and modulus operations. Not so fast, compresion requires 5 to 10 segs per MB. Decompression is much faster.
6
+
7
+
## ascii-art-rle.vbs
8
+
Uses a homebrew variant of the RLE line algorithm to compress ASCII art images with a lot of spaces. Not so good with images with shade gradients. It encodes pure ascii unique chars as 128+asc and lengths with the same char as 128+asc & 32+length.
Copy file name to clipboardExpand all lines: Documents/What_is_vbs.htm
+30-17Lines changed: 30 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ <h2>What is VBScript</h2>
15
15
<li>As as server side script language in IIS' Active Server Pages</li>
16
16
<li>As an alternate client side script language in html files intended to be viewed in Internet Explorer (deprecated! Use ECMAScript!)</li>
17
17
<li>As one of the script languages available in the HTML Applications (HTA);Standalone apps based in web interface running in mshta.exe.</li>
18
+
18
19
<li>As the main script language embedded in third party applications as </li>
19
20
<ul>
20
21
<li> HP QuickTest Professional (QTP), now Unified Functional Terting (UFT) software tester </li>
@@ -32,7 +33,7 @@ <h2>What is VBScript</h2>
32
33
</ul>
33
34
34
35
<p></p>
35
-
<h2>As a desktop aplication running in Windows Scripting Host:</h2>
36
+
<h2>Pros and cons as a desktop scripting language running in Windows Scripting Host:</h2>
36
37
<p></p>
37
38
<p></p>
38
39
<h3> Features: </h3>
@@ -47,57 +48,69 @@ <h3> Features: </h3>
47
48
<li>Has a built in object dictionary (an associative array)</li>
48
49
<li>Can interact with software as ActiveX controls, and COM automation servers and components using late binding.</li>
49
50
<ul>
51
+
50
52
<li>Has built in access to SQL queries to any database having an ODBC driver installed. </li>
51
53
<li>Built in SQL can search Windows internals as WMI, Windows Search,ASDI </li>
52
54
<li>Access to Microsoft XML parser</li>
53
55
<li>Access to ADODB.streams allowing to read and save text in different codepages, convert between them </li>
54
56
<li>If .NET is present it can access some handy containers as ArrayList, Stack or Queue </li>
55
57
<li>Can acces the object model of applications having VBA as their scripting interface, allowing to control them from outside</li>
58
+
56
59
</ul>
57
60
<li>Good date-time functions. But no UTC support</li>
58
61
<li>Support to Locale change (decimal separator, first day of week..)</li>
59
-
<li>supports named command line arguments</li>
62
+
<li>Supports named command line arguments allowing easy parsing.</li>
60
63
<li>Error reporting including the line number.</li>
61
-
<li>for each, with.
64
+
65
+
<li>for each, with.</li>
62
66
<li>Can run other non-COM apps, sending input to their sdin capturing their stdout live and getting their exit code at the end</li>
67
+
63
68
</ul>
64
69
65
70
<p></p>
66
71
<h3> Cons:</h3>
67
72
<ul>
68
73
<li>The acces to files is only sequential (text or binary), with no random access. </li>
74
+
69
75
<li>false is 0, not false is -1</li>
70
76
<li>no shift operations on bits. * and \ (integer division) must be used. </li>
71
77
<li>Numbers are converted from Double to SIGNED 32 bit integers for bitwise logic,integer division\ and modulus. Bit twiddling is complicated as the sign gets in the way. </li>
72
-
78
+
<li>Variants use a minimum of 16 bytes. A boolean value is 16 bytes </li>
79
+
<li>In boolean variables false is 0, not false is -1.</li>
80
+
<li>There are no shift operations on bits. * and \ (integer division) must be used. </li>
81
+
<li> Before performing \ MOD AND OR XOR NOT operators the double precision numbers are converted to a 32 bit SIGNED integer, so the sign bit must be dealed separately in bit twiddling to avoid funny results </li>
82
+
<li>No shift left - shift right, integer division and product must be used </li>
73
83
<li>No preprocessor support, no include, conditional compiling</li>
74
84
<li>No json support. </li>
75
-
<li>Arrays are static, REDIM PRESERVE must be used to change its size, no push-pop</li>
76
-
<li>No wilcards accepted in the filenames passed to folder/file handling functions</li>
85
+
<li>Arrays are static, REDIM PRESERVE must be used to change its size, no push-pop.</li>
86
+
87
+
<li>No wilcards are accepted in the filenames passed to folder/file handling functions.</li>
77
88
<li>It has not been given new features since Windows XP </li>
78
-
<li>Spotty Unicode support ascw and chrw. only UTF32</li>
89
+
<li>Spotty Unicode support ascw and chrw. Only UTF32. ODBC Streams allow conversion of text fies to UTF8</li>
79
90
<li>Strings don't allow indexing on write on them, to modify a string :
80
-
<ul><li> placeholders+ Replace,</li><li> regex must be used.</li><li> Or the string has to be built by concatenation</li></ul></li>
91
+
<ul><li> placeholders+ Replace,</li><li> regex must be used.</li><li> Or the string has to be built by concatenation</li></ul></li>
81
92
<li>Clumsy string indexing for reading asc(mid(s,i,1)) at the place of s[i]</li>
82
93
<li>No way to build a windows form, the official way is to write some html to a file and call Internet Explorer to display it and get user selections from it. </li>
83
94
<li>Windows from XP to W8.1 did'nt support ANSI escape codes so console apps using them will display garbage on these OS versions.</li>
84
95
<li>It can't get single characters from the keyboard, any user input must be terminated by enter. No shooting games!</li>
85
96
<li>It can't get mouse input, except clicks in buttons in the the two built-in forms MessageBox and (text)InputBox</li>
86
97
<li>Windows can default to two different runtimes Wscript and Cscript. In Wscript not all scripts will run. The main difference:</li>
87
98
<ul>
88
-
<li>Wscript can't open a console, </li>
89
-
<li>Wscript do not have access to the standard streams stdin,stdout and stderr, </li>
90
-
<li>Wscript can't be aborted with Ctrl-C.</li>
91
-
<li>Wscript.echo writes to console in CScript but in WScript it opens a generic MessageBox that must be acknowledged for the program to continue </li>
99
+
100
+
<li>Wscript does'nt open a console, </li>
101
+
<li>Wscript do not have access to the standard streams stdin,stdout and stderr, </li>
102
+
<li>Wscript can't be stopped with Ctrl-C.</li>
103
+
<li>Wscript.echo writes to console in CScript but in WScript it opens a generic MessageBox that must be acknowledged for the program to continue </li>
92
104
<li>The Wscript forms (Messagebox, InputBox and Popup) are available just the same in Cscript</li>
93
105
</ul>
94
-
<li>No access to a graphics screen, a file must be created and viewed in an external viewer (BMP or HTML including SVG), or ASCII (ANSI) art must be used. </li>
95
-
<li>no named or optional arguments in functions</li>
96
-
<li>No register or user defined variables. Arrays of variants may substitute them. There is no way of having a packed register for file I/O unless it's built byte to byte as a string.</li>
106
+
<li>No access to a graphics screen, a file must be created and viewed in an external viewer (BMP or HTML including SVG), or ASCII (ANSI) art must be used. </li>
107
+
<li>No named or optional arguments in functions</li>
108
+
<li>No register or user defined variables. Methodless classes are a workaround. There is no way of having a packed register for file I/O unless its built byte to byte as a string.</li>
97
109
<li>No continue or goto keywords. It has exit do/for/sub/function</li>
110
+
111
+
<li>Sketchy error handling: only On Error Resume Next and the err object</li>
112
+
<li>No formatted output equivalent to printf. Poor format functions, no align right</li>
98
113
99
-
<li>Sketchy error handling: only On Error Resume Next and the err object</li>
100
-
<li>No formatted output equivalent to printf. Format functions only for time/date and floating point values, no align right</li>
101
114
<li>Can't redimension or change console size or change charset.</li>
102
115
<li>The requirement to type <i>set fso=CreateObject("Scripting.FileSystemObject")</i> before using any file handling method should be punished by law.</li>
0 commit comments