ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Visual Basic Script
Π§Π°ΡΡΠΎ ΠΊΡΠΈΡΠΈΠΊΠ΅ ΠΏΠΎΠ΄Π²Π΅ΡΠ³Π°ΡΡΡΡ ΡΠ°ΠΊΠΈΠ΅ Π°ΡΠΏΠ΅ΠΊΡΡ Visual Basic, ΠΊΠ°ΠΊ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΎΡΠΊΠ»ΡΡΠΈΡΡ ΡΡΠ΅Π΄ΡΡΠ²Π° ΡΠ»Π΅ΠΆΠ΅Π½ΠΈΡ Π·Π° ΠΎΠ±ΡΡΠ²Π»Π΅Π½Π½ΡΠΌΠΈ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠΌΠΈ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ Π½Π΅ΡΠ²Π½ΠΎΠ³ΠΎ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ , Π½Π°Π»ΠΈΡΠΈΠ΅ ΡΠΈΠΏΠ° Π΄Π°Π½Π½ΡΡ «Variant». ΠΠΎ ΠΌΠ½Π΅Π½ΠΈΡ ΠΊΡΠΈΡΠΈΠΊΠΎΠ², ΡΡΠΎ Π΄Π°ΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΏΠΈΡΠ°ΡΡ ΠΊΡΠ°ΠΉΠ½Π΅ ΠΏΠ»ΠΎΡ ΠΎΠΉ ΠΊΠΎΠ΄. Π‘ Π΄ΡΡΠ³ΠΎΠΉ ΡΡΠΎΡΠΎΠ½Ρ, ΡΡΠΎ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ°ΡΡΠΌΠ°ΡΡΠΈΠ²Π°ΡΡ ΠΊΠ°ΠΊ ΠΏΠ»ΡΡ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ VB Π½Π΅ Π½Π°Π²ΡΠ·ΡΠ²Π°Π΅Ρ «Ρ ΠΎΡΠΎΡΠΈΠΉ ΡΡΠΈΠ»Ρ», Π° Π΄Π°ΡΡ Π±ΠΎΠ»ΡΡΠ΅ ΡΠ²ΠΎΠ±ΠΎΠ΄Ρ… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Visual Basic Script (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
ΠΠΈΠ½ΠΈΡΡΠ΅ΡΡΡΠ²ΠΎ ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ ΠΈ Π½Π°ΡΠΊΠΈ Π ΠΎΡΡΠΈΠΉΡΠΊΠΎΠΉ Π€Π΅Π΄Π΅ΡΠ°ΡΠΈΠΈ ΠΡΠΌΠ°Π½ΠΈΡΠ°ΡΠ½ΡΠΉ ΠΈΠ½ΡΡΠΈΡΡΡ ΠΠ°ΡΠ΅Π΄ΡΠ° ΠΠ½ΠΎΡΡΡΠ°Π½Π½ΡΡ ΡΠ·ΡΠΊΠΎΠ² № 1
ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Visual Basic Script
ΠΡΠΏΠΎΠ»Π½ΠΈΠ»: ΡΡΡΠ΄Π΅Π½Ρ Π³ΡΡΠΏΠΏΡ ΠΠ‘-09
ΠΠΆΠ΅ΠΊ ΠΡΡΡ ΠΠ»Π°Π΄ΠΈΠΌΠΈΡΠΎΠ²ΠΈΡ ΠΡΠΎΠ²Π΅ΡΠΈΠ»:
Π‘ΠΈΠ»ΡΠ½ΡΠ³ΠΈΠ½Π° ΠΠ°ΡΠΈΡ ΠΠ»Π°Π΄ΠΈΠΌΠΈΡΠΎΠ²Π½Π° Π’ΡΠΌΠ΅Π½Ρ, 2011
1. Introduction
Programming language — formal sign system designed for recording computer programs. The programming language defines a set of lexical, syntactical and semantical rules, that specify the appearance of programs and activities that comply with the Executive (the computer) under its management. One example is the programming language Visual Basic from Microsoft.
Microsoft Visual Basic — is a software development tool, developed by Microsoft, and includes a programming language and development environment. Visual Basic language has inherited the spirit, style and syntax part of his ancestor — the language BASIC, which has many dialects. At the same time, Visual Basic combines procedures and elements of object-oriented and component-oriented programming languages. VB development environment includes tools for visual designing the user interface.
Visual Basic considered being a good tool for rapid program prototyping, for database application development and, in general, for component ways to create programs that are running operating systems of Microsoft Windows family.
The first recognition by major developers Visual Basic received after the release of the third version — VB3. Final acceptance as a full-fledged programming tool for Windows — with the release of the fifth version — VB5. VB6 version, part of the Microsoft Visual Studio 6.0, has become a truly mature and feature-rich product. After that, the developers of Microsoft have significantly changed the development direction of this technology. As at September 2010 we can speak not only about classic Visual Basic, but also its dialects Visual Basic for Applications (VBA) and Visual Basic Scripting Edition (VBScript).
2. Visual Basic Scripting Edition
Visual Basic Scripting Edition (usually just VBScript) — scripting programming language, is interpreted by Windows Script Host. Is a few truncated version of the usual Visual Basic, appeared in 1991. In the middle of 1998 «seceded» from Visual Basic 6.0. VBScript is used mainly for automating administration of Windows systems, as well as to create ASP pages and scripts for Internet Explorer. VBScript is widely used in the creation of scripts in the operating systems of Microsoft Windows.
Scripting Language — programming language developed to write «scenarios», sequences of operations that a user can perform on the computer. Simple scripting languages earlier is often called batch processing languages. Scripts are typically interpreted rather than compiled (although increasingly adopted compile each time before running).
In the application, the script — is a program that automates some task that without a script the user would do manually, using the program interface.
Windows Script Host (WSH) — component of Microsoft Windows, designed to run scripts in a scripting language JScript and VBScript, as well as in other additional installed languages (e.g., Perl).
VBScript was created by Microsoft as a replacement for outdated batch language, language, is interpreted by application command.com.
COMMAND.COM — shell in the operating systems DOS, Windows 9x family and several others. Loaded at startup (if no other interpreter with SHELL = directive in the file CONFIG. SYS) and executes commands from the file AUTOEXEC.BAT.
3. VBScript scope
Scripts in VBScript language mostly used in the following areas, using the products Microsoft:
Β· automation of administration of Windows systems;
Β· server software code in the pages of the ASP;
Β· client scripts in the browser Internet Explorer.
This type of scenario is typically used for:
Β· creation of sophisticated scenarios;
Β· using objects from other applications and libraries;
Β· hide windows during script execution;
Β· encryption scriptlogic.
Mainly VBS — scripts are used for data processing, system management, working with user accounts and computers, interaction with business applications, working with data bases and other sophisticated tasks.
VBScript — is an ordinary text file named *.VBS, which is easy to edit in notepad, and launch on the execution — by double click or by calling the name in the console.
Scripts are not compiled but interpreted. That is to process the script in the system must be present interpreter of language VBS, and there are two such interpreters in the Windows: window WScript and console CScript, both this interpreters is Windows Script Host.
4. Language rules
In Visual Basic, are working the following rules:
Β· string length is not limited;
Β· no case-sensitive;
Β· the number of spaces between the parameters is not considered;
Β· command string can be break, and in brake point is necessary to insert the symbol «_» ;
Β· The maximum length of the variable name is 255 symbols;
Β· Comments are indicated by symbol" ' «.
5. Variables
By default, variables are declared in a script automatically on the first use in the script body, if it is not prohibited by the Option Explicit directive. If in the beginning of the script declare the directive Option Explicit, then all variables must be defined before by the following structures:
Dim ValueName1variable available for all subprograms;
Public ValueName2variable available for all subprograms;
Private ValueName3variable available only for the current program and its subprograms;
Constants are declared at the beginning of the script by using the construction:
Const ConstName1 = Value1constant, accessible for all subprograms;
PublicConst ConstName2 = Value2 constant, accessible for all subprograms;
PrivateConst ConstName3 = Value3constant, accessible only for the current program and its subprograms.
Variable type is assigned automatically after introduction of her first value. In Visual Basic there are the following data types:
Β· Empty — an uninitialized variable;
Β· Null — a null variable;
Β· Boolean — a logical type, the possible values: False, True or 0, 1;
Β· Byte — a 8-bitunsigned whole number, the possible values: 0. 255;
Β· Integer — a 16-bitwhole number, the possible values: -32 768. 32 767;
Β· Long — a 32-bitwhole number, the possible values: -2 147 483 648. 2 147 483 647;
Β· Currency — a money type, the possible values: -922 337 203 685 477,5808. 922 337 203 685 477,5807;
Β· Single — a floating point number, the possible values: -3.40 2823e38. -1.40 1298e-45 for negative numbers and 1.40 1298e-45 .3.40 2823e38 for positive numbers;
Β· Double — a floating point number, the possible values: 1.7 976 931 348 6232e308. -4.9 406 564 584 1247e-324 for negative numbers and4.9 406 564 584 1247e-324 .1.7 976 931 348 6232e308 for positive numbers;
Β· Date — a date, the possible values: 01.01.1900 ΠΈ 31.01.9999;
Β· String — a string variable, capacity up to 2 billion symbols;
Β· Object — a pointer at the object;
Β· Error — an error code.
In the VBS-scripts can be used arrays of variables, which allow you to store lists and tables and even more sophisticated designs. One-dimensional arrays (lists) can be dynamic, that is they can change their dimension during the work of scenario. All arrays are declared by command Dim:
Dim ArrayName (Dimension)
6. Objects, their methods and properties
visual basic ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠΊΡΠΈΠΏΡΠΎΠ²ΡΠΉ
VBS-scripts, like their parent — the Visual Basic language, are an object-oriented programming language, that is the basic concept is the notion of objects and classes.
Class — is a type that describes the object device. Object means something, which has a certain behavior and way of presenting, the object — is an instance of the class. The class can be compared with the drawing, according to which objects are created. Typically, classes are developing such a way, that their objects match with domain objects.
All objects, works with Windows Script Host, have methods and properties. In order to refer to a method it is necessary to indicate the object, and by the point — the method with the necessary parameters.
A similar situation with the properties, but properties can be assigned and read at variables and other properties, however, should consider the type of data variables and properties, otherwise the script will show an error of incompatibility of data types.
7. Advantages of Visual Basic
Β· Highspeed of creation of GUI applications for MS Windows.
Β· A simple syntax that lets very quick to learn a language.
Β· Ability to compile at native code as well as at P-code (by choice programmer). In debug mode the program always (regardless of the choice) is compiled at P-code, that allows to pause the program execution, to make considerable changes to the source code, and then to continue the execution: full recompile and restart of program is not required.
Β· Protection from the errors connected with the use of pointers and memory access. This aspect makes the Visual Basic applications more stable, but also an object of criticism.
Β· Ability to use most of the WinAPI functions for extending the functionality of the application. This issue is most completely investigated by Dan Appleman, who wrote «Visual Basic Programmer’s Guide to the Win32 API» .
8. Disadvantages of Visual Basic
Β· Supported operating systems only in Windows and Mac OS X families (Exception — VB1 for DOS).
Β· No mechanism for implementation inheritance of objects. The existing in the language inheritance can only inherit interfaces, but not their implementation.
Β· Requires establishing msvbvmXX. dll for the program’s work.
Β· Slow speed of the work, caused by the fact, that practically all of the embedded language functions are realized through runtime library, which, in turn, produces a lot of «unnecessary» work on verification and/or on type conversion.
9. Example
Here is an example of a small program in VBScript, which displays a dialog box with the message (symbols after the apostrophe are comments):
' Declare a variable:
Dim strMessage
' Assigning a value to a variable:
strMessage = «IS-09»
' Output window with the message:
MsgBox strMessage
By the effect of work it is similar to the direct instruction:
MsgBox «IS-09»
10. Conclusion
Often criticism such of Visual Basic aspects, as ability to disable monitoring tools of declare variables, the possibility of an implicit transformation of variables, availability of data type «Variant». Critics say that this makes possible to write very bad code. From other side, this can be considered as a plus, because VB does not impose a «good style», that gives more freedom to the programmer.
The absence of pointers, low-level access to memory, ASM-inserts — despite the fact, that the paradigm of Visual Basic allows the average VB-programmer to do without all this, these things are also often subject to criticism. And while using undocumented possibilities and some tweaks, all can be realized and on VB (e.g. using the functions for receiving pointers VarPtr (), StrPtr () and ObjPtr ()); use these tricks is much more difficult than, for example, in C++.
However, it should be noted that all the disadvantages of language proceed from his main advantages — simplicity of GUI development. Therefore, many programmers use Visual Basic for developing the user interface and functionality of the program is realized as dynamic-link library (DLL), written in another Language (usually C + +).
ΠΠΎΠΊΠ»Π°Π΄ Π―Π·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ — ΡΠΎΡΠΌΠ°Π»ΡΠ½Π°Ρ Π·Π½Π°ΠΊΠΎΠ²Π°Ρ ΡΠΈΡΡΠ΅ΠΌΠ°, ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½Π½Π°Ρ Π΄Π»Ρ Π·Π°ΠΏΠΈΡΠΈ ΠΊΠΎΠΌΠΏΡΡΡΠ΅ΡΠ½ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ. Π―Π·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΠ΅Ρ Π½Π°Π±ΠΎΡ Π»Π΅ΠΊΡΠΈΡΠ΅ΡΠΊΠΈΡ , ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡΠ΅ΡΠΊΠΈΡ ΠΈ ΡΠ΅ΠΌΠ°Π½ΡΠΈΡΠ΅ΡΠΊΠΈΡ ΠΏΡΠ°Π²ΠΈΠ», Π·Π°Π΄Π°ΡΡΠΈΡ Π²Π½Π΅ΡΠ½ΠΈΠΉ Π²ΠΈΠ΄ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΈ Π΄Π΅ΠΉΡΡΠ²ΠΈΡ, ΠΊΠΎΡΠΎΡΡΠ΅ Π²ΡΠΏΠΎΠ»Π½ΠΈΡ ΠΈΡΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»Ρ (ΠΊΠΎΠΌΠΏΡΡΡΠ΅Ρ) ΠΏΠΎΠ΄ Π΅Π΅ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ΠΌ. ΠΠ΄Π½ΠΈΠΌ ΠΈΠ· ΠΏΡΠΈΠΌΠ΅ΡΠΎΠ² ΡΠ·ΡΠΊΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠ²Π»ΡΠ΅ΡΡΡ Visual Basic ΠΊΠΎΡΠΏΠΎΡΠ°ΡΠΈΠΈ Microsoft.
Microsoft Visual Basic — ΡΡΠ΅Π΄ΡΡΠ²ΠΎ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎΠ³ΠΎ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΡ, ΡΠ°Π·ΡΠ°Π±Π°ΡΡΠ²Π°Π΅ΠΌΠΎΠ΅ ΠΊΠΎΡΠΏΠΎΡΠ°ΡΠΈΠ΅ΠΉ Microsoft ΠΈ Π²ΠΊΠ»ΡΡΠ°ΡΡΠ΅Π΅ ΡΠ·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΈ ΡΡΠ΅Π΄Ρ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ. Π―Π·ΡΠΊ Visual Basic ΡΠ½Π°ΡΠ»Π΅Π΄ΠΎΠ²Π°Π» Π΄ΡΡ , ΡΡΠΈΠ»Ρ ΠΈ ΠΎΡΡΠ°ΡΡΠΈ ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡ ΡΠ²ΠΎΠ΅Π³ΠΎ ΠΏΡΠ΅Π΄ΠΊΠ° — ΡΠ·ΡΠΊΠ° ΠΠ΅ΠΉΡΠΈΠΊ, Ρ ΠΊΠΎΡΠΎΡΠΎΠ³ΠΎ Π΅ΡΡΡ Π½Π΅ΠΌΠ°Π»ΠΎ Π΄ΠΈΠ°Π»Π΅ΠΊΡΠΎΠ². Π ΡΠΎ ΠΆΠ΅ Π²ΡΠ΅ΠΌΡ Visual Basic ΡΠΎΡΠ΅ΡΠ°Π΅Ρ Π² ΡΠ΅Π±Π΅ ΠΏΡΠΎΡΠ΅Π΄ΡΡΡ ΠΈ ΡΠ»Π΅ΠΌΠ΅Π½ΡΡ ΠΎΠ±ΡΠ΅ΠΊΡΠ½ΠΎ-ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ ΠΈ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΠ½ΠΎ-ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ ΡΠ·ΡΠΊΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ. Π‘ΡΠ΅Π΄Π° ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ VB Π²ΠΊΠ»ΡΡΠ°Π΅Ρ ΠΈΠ½ΡΡΡΡΠΌΠ΅Π½ΡΡ Π΄Π»Ρ Π²ΠΈΠ·ΡΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΊΠΎΠ½ΡΡΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΡΠΊΠΎΠ³ΠΎ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΠ°.
Visual Basic ΡΡΠΈΡΠ°Π΅ΡΡΡ Ρ ΠΎΡΠΎΡΠΈΠΌ ΡΡΠ΅Π΄ΡΡΠ²ΠΎΠΌ Π±ΡΡΡΡΠΎΠΉ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ ΠΏΡΠΎΡΠΎΡΠΈΠΏΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, Π΄Π»Ρ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ Π±Π°Π· Π΄Π°Π½Π½ΡΡ ΠΈ Π²ΠΎΠΎΠ±ΡΠ΅ Π΄Π»Ρ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΠ½ΠΎΠ³ΠΎ ΡΠΏΠΎΡΠΎΠ±Π° ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ, ΡΠ°Π±ΠΎΡΠ°ΡΡΠΈΡ ΠΏΠΎΠ΄ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ΠΌ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌ ΡΠ΅ΠΌΠ΅ΠΉΡΡΠ²Π° Microsoft Windows.
ΠΠ΅ΡΠ²ΠΎΠ΅ ΠΏΡΠΈΠ·Π½Π°Π½ΠΈΠ΅ ΡΠ΅ΡΡΡΠ·Π½ΡΠΌΠΈ ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊΠ°ΠΌΠΈ Visual Basic ΠΏΠΎΠ»ΡΡΠΈΠ» ΠΏΠΎΡΠ»Π΅ Π²ΡΡ ΠΎΠ΄Π° Π²Π΅ΡΡΠΈΠΈ 3 — VB3. ΠΠΊΠΎΠ½ΡΠ°ΡΠ΅Π»ΡΠ½ΠΎΠ΅ ΠΏΡΠΈΠ·Π½Π°Π½ΠΈΠ΅ ΠΊΠ°ΠΊ ΠΏΠΎΠ»Π½ΠΎΡΠ΅Π½Π½ΠΎΠ³ΠΎ ΡΡΠ΅Π΄ΡΡΠ²Π° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π΄Π»Ρ Windows — ΠΏΡΠΈ Π²ΡΡ ΠΎΠ΄Π΅ Π²Π΅ΡΡΠΈΠΈ 5 — VB5. ΠΠ΅ΡΡΠΈΡ VB6, Π²Ρ ΠΎΠ΄ΡΡΠ°Ρ Π² ΡΠΎΡΡΠ°Π² Microsoft Visual Studio 6.0, ΡΡΠ°Π»Π° ΠΏΠΎ-Π½Π°ΡΡΠΎΡΡΠ΅ΠΌΡ Π·ΡΠ΅Π»ΡΠΌ ΠΈ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎ Π±ΠΎΠ³Π°ΡΡΠΌ ΠΏΡΠΎΠ΄ΡΠΊΡΠΎΠΌ. ΠΠΎΡΠ»Π΅ ΡΡΠΎΠ³ΠΎ ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΈ ΠΈΠ· Microsoft ΡΡΡΠ΅ΡΡΠ²Π΅Π½Π½ΠΎ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠ»ΠΈ Π½Π°ΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ ΡΠ°Π·Π²ΠΈΡΠΈΡ Π΄Π°Π½Π½ΠΎΠΉ ΡΠ΅Ρ Π½ΠΎΠ»ΠΎΠ³ΠΈΠΈ. ΠΠΎ ΡΠΎΡΡΠΎΡΠ½ΠΈΡ Π½Π° ΡΠ΅Π½ΡΡΠ±ΡΡ 2010 Π³ΠΎΠ΄Π° ΠΌΠΎΠΆΠ½ΠΎ Π³ΠΎΠ²ΠΎΡΠΈΡΡ Π½Π΅ ΡΠΎΠ»ΡΠΊΠΎ ΠΎ ΠΊΠ»Π°ΡΡΠΈΡΠ΅ΡΠΊΠΎΠΌ Visual Basic, Π½ΠΎ ΠΈ ΠΎ Π΅Π³ΠΎ Π΄ΠΈΠ°Π»Π΅ΠΊΡΠ°Ρ Visual Basic for Applications (VBA) ΠΈ Visual Basic Scripting Edition (VBScript).
Visual Basic Scripting Edition
Visual Basic Scripting Edition (ΠΎΠ±ΡΡΠ½ΠΎ ΠΏΡΠΎΡΡΠΎ VBScript) — ΡΠΊΡΠΈΠΏΡΠΎΠ²ΡΠΉ ΡΠ·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠΈΡΡΠ΅ΠΌΡΠΉ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΠΎΠΌ Windows Script Host. Π―Π²Π»ΡΠ΅ΡΡΡ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΡΠ΅ΡΡΠ½Π½ΠΎΠΉ Π²Π΅ΡΡΠΈΠ΅ΠΉ ΠΎΠ±ΡΡΠ½ΠΎΠ³ΠΎ Visual Basic, ΠΏΠΎΡΠ²ΠΈΠ²ΡΠ΅Π³ΠΎΡΡ Π² 1991 Π³ΠΎΠ΄Ρ. Π ΡΠ΅ΡΠ΅Π΄ΠΈΠ½Π΅ 1998 Π³ΠΎΠ΄Π° «ΠΎΡΠ΄Π΅Π»ΠΈΠ»ΡΡ» ΠΎΡ Visual Basic 6.0. VBScript ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ, Π² ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΌ, Π΄Π»Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·Π°ΡΠΈΠΈ Π°Π΄ΠΌΠΈΠ½ΠΈΡΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠΈΡΡΠ΅ΠΌ Windows, Π° ΡΠ°ΠΊΠΆΠ΅ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΡΡΡΠ°Π½ΠΈΡ ASP ΠΈ ΡΡΠ΅Π½Π°ΡΠΈΠ΅Π² Π΄Π»Ρ Internet Explorer. VBScript ΡΠΈΡΠΎΠΊΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ ΠΏΡΠΈ ΡΠΎΠ·Π΄Π°Π½ΠΈΠΈ ΡΠΊΡΠΈΠΏΡΠΎΠ² Π² ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌΠ°Ρ ΡΠ΅ΠΌΠ΅ΠΉΡΡΠ²Π° Microsoft Windows.
Π‘ΠΊΡΠΈΠΏΡΠΎΠ²ΡΠΉ ΡΠ·ΡΠΊ (Π² ΡΡΡΡΠΊΠΎΡΠ·ΡΡΠ½ΠΎΠΉ Π»ΠΈΡΠ΅ΡΠ°ΡΡΡΠ΅ ΠΏΡΠΈΠ½ΡΡΠΎ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΠ·ΡΠΊ ΡΡΠ΅Π½Π°ΡΠΈΠ΅Π²) — ΡΠ·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΡΠ°Π·ΡΠ°Π±ΠΎΡΠ°Π½Π½ΡΠΉ Π΄Π»Ρ Π·Π°ΠΏΠΈΡΠΈ «ΡΡΠ΅Π½Π°ΡΠΈΠ΅Π²», ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°ΡΠ΅Π»ΡΠ½ΠΎΡΡΠ΅ΠΉ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΉ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ ΠΌΠΎΠΆΠ΅Ρ Π²ΡΠΏΠΎΠ»Π½ΡΡΡ Π½Π° ΠΊΠΎΠΌΠΏΡΡΡΠ΅ΡΠ΅. ΠΡΠΎΡΡΡΠ΅ ΡΠΊΡΠΈΠΏΡΠΎΠ²ΡΠ΅ ΡΠ·ΡΠΊΠΈ ΡΠ°Π½ΡΡΠ΅ ΡΠ°ΡΡΠΎ Π½Π°Π·ΡΠ²Π°Π»ΠΈ ΡΠ·ΡΠΊΠ°ΠΌΠΈ ΠΏΠ°ΠΊΠ΅ΡΠ½ΠΎΠΉ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΠΈ. Π‘ΡΠ΅Π½Π°ΡΠΈΠΈ ΠΎΠ±ΡΡΠ½ΠΎ ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠΈΡΡΡΡΡΡ, Π° Π½Π΅ ΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΡΡΡΡΡ (Ρ ΠΎΡΡ Π²ΡΡ ΡΠ°ΡΠ΅ ΠΏΡΠΈΠΌΠ΅Π½ΡΡΡ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΡ ΠΊΠ°ΠΆΠ΄ΡΠΉ ΡΠ°Π· ΠΏΠ΅ΡΠ΅Π΄ Π·Π°ΠΏΡΡΠΊΠΎΠΌ).
Π ΠΏΡΠΈΠΊΠ»Π°Π΄Π½ΠΎΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅, ΡΡΠ΅Π½Π°ΡΠΈΠΉ (ΡΠΊΡΠΈΠΏΡ) — ΡΡΠΎ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°, ΠΊΠΎΡΠΎΡΠ°Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·ΠΈΡΡΠ΅Ρ Π½Π΅ΠΊΠΎΡΠΎΡΡΡ Π·Π°Π΄Π°ΡΡ, ΠΊΠΎΡΠΎΡΡΡ Π±Π΅Π· ΡΡΠ΅Π½Π°ΡΠΈΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ Π΄Π΅Π»Π°Π» Π±Ρ Π²ΡΡΡΠ½ΡΡ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ.
Windows Script Host (WSH) — ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Microsoft Windows, ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½Π½ΡΠΉ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° ΡΡΠ΅Π½Π°ΡΠΈΠ΅Π² Π½Π° ΡΠΊΡΠΈΠΏΡΠΎΠ²ΡΡ ΡΠ·ΡΠΊΠ°Ρ JScript ΠΈ VBScript, Π° ΡΠ°ΠΊΠΆΠ΅ ΠΈ Π½Π° Π΄ΡΡΠ³ΠΈΡ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΠΎ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌΡΡ ΡΠ·ΡΠΊΠ°Ρ (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, Perl).
VBScript Π±ΡΠ» ΡΠΎΠ·Π΄Π°Π½ ΠΊΠΎΠΌΠΏΠ°Π½ΠΈΠ΅ΠΉ Microsoft ΠΊΠ°ΠΊ Π·Π°ΠΌΠ΅Π½Π° ΡΡΡΠ°ΡΠ΅Π²ΡΠ΅ΠΌΡ ΠΏΠ°ΠΊΠ΅ΡΠ½ΠΎΠΌΡ ΡΠ·ΡΠΊΡ, ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠΈΡΡΠ΅ΠΌΠΎΠΌΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ command.com.
COMMAND.COM — ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠ°ΡΠΎΡ ΠΊΠΎΠΌΠ°Π½Π΄Π½ΠΎΠΉ ΡΡΡΠΎΠΊΠΈ Π² ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌΠ°Ρ DOS, ΡΠ΅ΠΌΠ΅ΠΉΡΡΠ²Π° Windows 9x ΠΈ ΡΡΠ΄Π° Π΄ΡΡΠ³ΠΈΡ . ΠΠ°Π³ΡΡΠΆΠ°Π΅ΡΡΡ ΠΏΡΠΈ ΡΡΠ°ΡΡΠ΅ ΡΠΈΡΡΠ΅ΠΌΡ (Π΅ΡΠ»ΠΈ Π½Π΅ ΡΠΊΠ°Π·Π°Π½ Π΄ΡΡΠ³ΠΎΠΉ ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠ°ΡΠΎΡ Ρ ΠΏΠΎΠΌΠΎΡΡΡ Π΄ΠΈΡΠ΅ΠΊΡΠΈΠ²Ρ SHELL= Π² ΡΠ°ΠΉΠ»Π΅ CONFIG. SYS) ΠΈ Π²ΡΠΏΠΎΠ»Π½ΡΠ΅Ρ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΠΈΠ· ΡΠ°ΠΉΠ»Π° AUTOEXEC.BAT.
ΠΠ±Π»Π°ΡΡΡ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΡ VBScript
Π‘ΠΊΡΠΈΠΏΡΡ Π½Π° ΡΠ·ΡΠΊΠ΅ VBScript ΡΠ°ΡΠ΅ Π²ΡΠ΅Π³ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡΡΡΡ Π² ΡΠ»Π΅Π΄ΡΡΡΠΈΡ ΠΎΠ±Π»Π°ΡΡΡΡ , ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡΡΠΈΡ ΠΏΡΠΎΠ΄ΡΠΊΡΠΈΡ Microsoft:
Β· Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·Π°ΡΠΈΡ Π°Π΄ΠΌΠΈΠ½ΠΈΡΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠΈΡΡΠ΅ΠΌ Windows;
Β· ΡΠ΅ΡΠ²Π΅ΡΠ½ΡΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΡΠΉ ΠΊΠΎΠ΄ Π² ΡΡΡΠ°Π½ΠΈΡΠ°Ρ ASP;
Β· ΠΊΠ»ΠΈΠ΅Π½ΡΡΠΊΠΈΠ΅ ΡΠΊΡΠΈΠΏΡΡ Π² Π±ΡΠ°ΡΠ·Π΅ΡΠ΅ Internet Explorer.
Π’Π°ΠΊΠΎΠΉ ΡΠΈΠΏ ΡΡΠ΅Π½Π°ΡΠΈΠ΅Π² ΠΎΠ±ΡΡΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π΄Π»Ρ:
Β· ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΡΠ»ΠΎΠΆΠ½ΡΡ ΡΡΠ΅Π½Π°ΡΠΈΠ΅Π²;
Β· ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² ΠΈΠ· Π΄ΡΡΠ³ΠΈΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ ΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊ;
Β· ΡΠΊΡΡΡΠΈΡ ΠΎΠΊΠΎΠ½ Π² Ρ ΠΎΠ΄Π΅ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΡΡΠ΅Π½Π°ΡΠΈΡ;
Β· ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ Π»ΠΎΠ³ΠΈΠΊΠΈ ΡΡΠ΅Π½Π°ΡΠΈΡ.
Π ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΌ VBS-ΡΡΠ΅Π½Π°ΡΠΈΠΈ ΠΏΡΠΈΠΌΠ΅Π½ΡΡΡΡΡ Π΄Π»Ρ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΠΈ Π΄Π°Π½Π½ΡΡ , ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΠΈΡΡΠ΅ΠΌΠΎΠΉ, ΡΠ°Π±ΠΎΡΡ Ρ ΡΡΠ΅ΡΠ½ΡΠΌΠΈ Π·Π°ΠΏΠΈΡΡΠΌΠΈ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ ΠΈ ΠΊΠΎΠΌΠΏΡΡΡΠ΅ΡΠΎΠ², Π²Π·Π°ΠΈΠΌΠΎΠ΄Π΅ΠΉΡΡΠ²ΠΈΡ Ρ ΠΎΡΠΈΡΠ½ΡΠΌΠΈ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡΠΌΠΈ, ΡΠ°Π±ΠΎΡΡ Ρ Π±Π°Π·Π°ΠΌΠΈ Π΄Π°Π½Π½ΡΠΌΠΈ ΠΈ ΠΏΡΠΎΡΠΈΡ ΡΠ»ΠΎΠΆΠ½ΡΡ Π·Π°Π΄Π°Ρ.
VBS-ΡΡΠ΅Π½Π°ΡΠΈΠΉ — ΡΡΠΎ ΠΎΠ±ΡΡΠ½ΡΠΉ ΡΠ΅ΠΊΡΡΠΎΠ²ΡΠΉ ΡΠ°ΠΉΠ» Ρ ΠΈΠΌΠ΅Π½Π΅ΠΌ *.VBS, ΠΊΠΎΡΠΎΡΡΠΉ Π»Π΅Π³ΠΊΠΎ ΠΏΡΠ°Π²ΠΈΡΡ Π² Π±Π»ΠΎΠΊΠ½ΠΎΡΠ΅, Π° Π·Π°ΠΏΡΡΠΊΠ°ΡΡ Π½Π° ΠΈΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ — Π΄Π²ΠΎΠΉΠ½ΡΠΌ ΡΠ΅Π»ΡΠΊΠΎΠΌ ΠΌΡΡΠΈ ΠΈΠ»ΠΈ Π²ΡΠ·ΠΎΠ²ΠΎΠΌ ΠΏΠΎ ΠΈΠΌΠ΅Π½ΠΈ Π² ΠΊΠΎΠ½ΡΠΎΠ»ΠΈ.
Π‘ΡΠ΅Π½Π°ΡΠΈΠΈ Π½Π΅ ΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΡΡΡΡΡ, Π° ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠΈΡΡΡΡΡΡ. Π’ΠΎ Π΅ΡΡΡ Π΄Π»Ρ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΠΈ ΡΠΊΡΠΈΠΏΡΠ° Π² ΡΠΈΡΡΠ΅ΠΌΠ΅ Π΄ΠΎΠ»ΠΆΠ΅Π½ ΠΏΡΠΈΡΡΡΡΡΠ²ΠΎΠ²Π°ΡΡ ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠ°ΡΠΎΡ ΡΠ·ΡΠΊΠ° VBS, ΠΈ ΡΠ°ΠΊΠΈΡ ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠ°ΡΠΎΡΠΎΠ² Π² Windows Π΄Π²Π°: ΠΎΠΊΠΎΠ½Π½ΡΠΉ WScript ΠΈ ΠΊΠΎΠ½ΡΠΎΠ»ΡΠ½ΡΠΉ CScript, ΠΎΠ±Π° ΠΈΠ½ΡΠ΅ΡΠΏΡΠ΅ΡΠ°ΡΠΎΡΠ° ΡΡΠΎ Windows Script Host.
ΠΡΠ°Π²ΠΈΠ»Π° ΡΠ·ΡΠΊΠ° Π Visual Basic ΡΠ°Π±ΠΎΡΠ°ΡΡ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΠΏΡΠ°Π²ΠΈΠ»Π°:
Β· Π΄Π»ΠΈΠ½Π° ΡΡΡΠΎΠΊΠΈ Π½Π΅ ΠΎΠ³ΡΠ°Π½ΠΈΡΠ΅Π½Π°;
Β· ΡΠ΅Π³ΠΈΡΡΡ ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ² Π½Π΅ ΡΡΠΈΡΡΠ²Π°Π΅ΡΡΡ;
Β· ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΠΏΡΠΎΠ±Π΅Π»ΠΎΠ² ΠΌΠ΅ΠΆΠ΄Ρ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠ°ΠΌΠΈ Π½Π΅ ΡΡΠΈΡΡΠ²Π°Π΅ΡΡΡ;
Β· ΡΡΡΠΎΠΊΡ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ°Π·ΡΡΠ²Π°ΡΡ, Π° Π½Π° ΠΌΠ΅ΡΡΠ΅ ΡΠ°Π·ΡΡΠ²Π° Π½ΡΠΆΠ½ΠΎ Π²ΡΡΠ°Π²Π»ΡΡΡ ΡΠΈΠΌΠ²ΠΎΠ» «_ «;
Β· ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½Π°Ρ Π΄Π»ΠΈΠ½Π° ΠΈΠΌΠ΅Π½ΠΈ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ 255 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²;
Β· ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ ΠΎΠ±ΠΎΠ·Π½Π°ΡΠ°ΡΡΡΡ ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠΌ «' «.
ΠΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΠΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ Π² ΡΡΠ΅Π½Π°ΡΠΈΡΡ ΠΎΠ±ΡΡΠ²Π»ΡΡΡΡΡ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΏΡΠΈ ΠΏΠ΅ΡΠ²ΠΎΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠΈ Π² ΡΠ΅Π»Π΅ ΡΠΊΡΠΈΠΏΡΠ°, Π΅ΡΠ»ΠΈ ΡΡΠΎ Π½Π΅ Π·Π°ΠΏΡΠ΅ΡΠ΅Π½ΠΎ Π΄ΠΈΡΠ΅ΠΊΡΠΈΠ²ΠΎΠΉ Option Explicit. ΠΡΠ»ΠΈ ΠΆΠ΅ Π² Π½Π°ΡΠ°Π»Π΅ ΡΡΠ΅Π½Π°ΡΠΈΡ ΠΎΠ±ΡΡΠ²ΠΈΡΡ Π΄ΠΈΡΠ΅ΠΊΡΠΈΠ²Ρ Option Explicit, ΡΠΎ Π²ΡΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ Π½ΡΠΆΠ½ΠΎ ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΡΡ Π·Π°ΡΠ°Π½Π΅Π΅ Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΡΠ»Π΅Π΄ΡΡΡΠΈΡ ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΈΠΉ:
Dim ValueName1ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ, Π΄ΠΎΡΡΡΠΏΠ½Π°Ρ Π²ΡΠ΅ΠΌ ΠΏΠΎΠ΄ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°ΠΌ;
Public ValueName2ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ, Π΄ΠΎΡΡΡΠΏΠ½Π°Ρ Π²ΡΠ΅ΠΌ ΠΏΠΎΠ΄ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°ΠΌ;
Private ValueName3ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ, Π΄ΠΎΡΡΡΠΏΠ½Π°Ρ ΡΠΎΠ»ΡΠΊΠΎ ΡΠ΅ΠΊΡΡΠ΅ΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΠΈ Π΅Π΅ ΠΏΠΎΠ΄ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°ΠΌ;
ΠΠΎΠ½ΡΡΠ°Π½ΡΡ ΠΎΠ±ΡΡΠ²Π»ΡΡΡΡΡ Π² Π½Π°ΡΠ°Π»Π΅ ΡΡΠ΅Π½Π°ΡΠΈΡ Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΈΠΈ:
Const ConstName1 = Value1ΠΊΠΎΠ½ΡΡΠ°Π½ΡΠ°, Π΄ΠΎΡΡΡΠΏΠ½Π°Ρ Π²ΡΠ΅ΠΌ ΠΏΠΎΠ΄ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°ΠΌ;
PublicConst ConstName2 = Value2 ΠΊΠΎΠ½ΡΡΠ°Π½ΡΠ°, Π΄ΠΎΡΡΡΠΏΠ½Π°Ρ Π²ΡΠ΅ΠΌ ΠΏΠΎΠ΄ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°ΠΌ;
PrivateConst ConstName3 = Value3 ΠΊΠΎΠ½ΡΡΠ°Π½ΡΠ°, Π΄ΠΎΡΡΡΠΏΠ½Π°Ρ ΡΠΎΠ»ΡΠΊΠΎ ΡΠ΅ΠΊΡΡΠ΅ΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΠΈ Π΅Π΅ ΠΏΠΎΠ΄ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ°ΠΌ.
Π’ΠΈΠΏ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ ΠΏΡΠΈΡΠ²Π°ΠΈΠ²Π°Π΅ΡΡΡ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΏΠΎΡΠ»Π΅ Π²Π½Π΅ΡΠ΅Π½ΠΈΡ Π² Π½Π΅Ρ ΠΏΠ΅ΡΠ²ΠΎΠ³ΠΎ Π·Π½Π°ΡΠ΅Π½ΠΈΡ. Π Visual Basic ΡΡΡΠ΅ΡΡΠ²ΡΡΡ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΡΠΈΠΏΡ Π΄Π°Π½Π½ΡΡ :
Β· empty — Π½Π΅ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΠΎΠ²Π°Π½Π½Π°Ρ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ;
Β· null — ΠΏΡΡΡΠ°Ρ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ;
Β· boolean — Π»ΠΎΠ³ΠΈΡΠ΅ΡΠΊΠΈΠΉ ΡΠΈΠΏ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: False, True ΠΈΠ»ΠΈ 0, 1;
Β· byte — 8-Π±ΠΈΡΠ½ΠΎΠ΅ ΡΠ΅Π»ΠΎΠ΅ ΡΠΈΡΠ»ΠΎ Π±Π΅Π· Π·Π½Π°ΠΊΠ°, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: 0. 255;
Β· integer — 16-Π±ΠΈΡΠ½ΠΎΠ΅ ΡΠ΅Π»ΠΎΠ΅ ΡΠΈΡΠ»ΠΎ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: -32 768. 32 767;
Β· long — 32-Π±ΠΈΡΠ½ΠΎΠ΅ ΡΠ΅Π»ΠΎΠ΅ ΡΠΈΡΠ»ΠΎ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: -2 147 483 648. 2 147 483 647;
Β· currency — Π΄Π΅Π½Π΅ΠΆΠ½ΡΠΉ ΡΠΈΠΏ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: -922 337 203 685 477,5808 Π΄ΠΎ 922 337 203 685 477,5807;
Β· single — ΡΠΈΡΠ»ΠΎ Ρ ΠΏΠ»Π°Π²Π°ΡΡΠ΅ΠΉ ΡΠΎΡΠΊΠΎΠΉ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: -3.40 2823e38. -1.40 1298e-45 Π΄Π»Ρ ΠΎΡΡΠΈΡΠ°ΡΠ΅Π»ΡΠ½ΡΡ ΡΠΈΡΠ΅Π» ΠΈ 1.40 1298e-45. 3.40 2823e38 Π΄Π»Ρ ΠΏΠΎΠ»ΠΎΠΆΠΈΡΠ΅Π»ΡΠ½ΡΡ ΡΠΈΡΠ΅Π»;
Β· double — ΡΠΈΡΠ»ΠΎ Ρ ΠΏΠ»Π°Π²Π°ΡΡΠ΅ΠΉ ΡΠΎΡΠΊΠΎΠΉ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: 1.7 976 931 348 6232e308. -4.9 406 564 584 1247e-324 Π΄Π»Ρ ΠΎΡΡΠΈΡΠ°ΡΠ΅Π»ΡΠ½ΡΡ ΡΠΈΡΠ΅Π» ΠΈ 4.9 406 564 584 1247e-324. 1.7 976 931 348 6232e308 Π΄Π»Ρ ΠΏΠΎΠ»ΠΎΠΆΠΈΡΠ΅Π»ΡΠ½ΡΡ ΡΠΈΡΠ΅Π»;
Β· date — Π΄Π°ΡΠ°, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: 01.01.1900 ΠΈ 31.01.9999;
Β· string — ΡΡΡΠΎΠΊΠΎΠ²Π°Ρ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ, Π²ΠΌΠ΅ΡΡΠΈΠΌΠΎΡΡΡ Π΄ΠΎ 2 ΠΌΠΈΠ»Π»ΠΈΠ°ΡΠ΄ΠΎΠ² ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²;
Β· object — ΡΠΊΠ°Π·Π°ΡΠ΅Π»Ρ Π½Π° ΠΎΠ±ΡΠ΅ΠΊΡ;
Β· error — ΠΊΠΎΠ΄ ΠΎΡΠΈΠ±ΠΊΠΈ.
Π VBS-ΡΡΠ΅Π½Π°ΡΠΈΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΠΌΠ°ΡΡΠΈΠ²ΠΎΠ² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ , ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡ Ρ ΡΠ°Π½ΠΈΡΡ ΡΠΏΠΈΡΠΊΠΈ, ΡΠ°Π±Π»ΠΈΡΡ ΠΈ Π΄Π°ΠΆΠ΅ Π±ΠΎΠ»Π΅Π΅ ΡΠ»ΠΎΠΆΠ½ΡΠ΅ ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΈΠΈ. ΠΠ΄Π½ΠΎΠΌΠ΅ΡΠ½ΡΠ΅ ΠΌΠ°ΡΡΠΈΠ²Ρ (ΡΠΏΠΈΡΠΊΠΈ) ΠΌΠΎΠ³ΡΡ Π±ΡΡΡ Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΈΠΌΠΈ, ΡΠΎ Π΅ΡΡΡ ΠΎΠ½ΠΈ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡ ΠΈΠ·ΠΌΠ΅Π½ΡΡΡ ΡΠ²ΠΎΡ ΡΠ°Π·ΠΌΠ΅ΡΠ½ΠΎΡΡΡ Π² Ρ ΠΎΠ΄Π΅ ΡΠ°Π±ΠΎΡΡ ΡΡΠ΅Π½Π°ΡΠΈΡ. ΠΡΠ΅ ΠΌΠ°ΡΡΠΈΠ²Ρ ΠΎΠ±ΡΡΠ²Π»ΡΡΡΡΡ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ Dim:
Dim ArrayName (Dimension)
ΠΠ±ΡΠ΅ΠΊΡΡ, ΠΈΡ ΠΌΠ΅ΡΠΎΠ΄Ρ ΠΈ ΡΠ²ΠΎΠΉΡΡΠ²Π°
VBS-ΡΡΠ΅Π½Π°ΡΠΈΠΈ, ΠΊΠ°ΠΊ ΠΈ ΠΈΡ ΡΠΎΠ΄ΠΈΡΠ΅Π»Ρ — ΡΠ·ΡΠΊ Visual Basic, ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΠ±ΡΠ΅ΠΊΡΠ½ΠΎ-ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΠΌ ΡΠ·ΡΠΊΠΎΠΌ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΡΠΎ Π΅ΡΡΡ ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΠΊΠΎΠ½ΡΠ΅ΠΏΡΠΈΠ΅ΠΉ ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΏΠΎΠ½ΡΡΠΈΠ΅ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² ΠΈ ΠΊΠ»Π°ΡΡΠΎΠ².
ΠΠ»Π°ΡΡ — ΡΡΠΎ ΡΠΈΠΏ, ΠΎΠΏΠΈΡΡΠ²Π°ΡΡΠΈΠΉ ΡΡΡΡΠΎΠΉΡΡΠ²ΠΎ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ². ΠΠ±ΡΠ΅ΠΊΡ ΠΏΠΎΠ΄ΡΠ°Π·ΡΠΌΠ΅Π²Π°Π΅Ρ ΠΏΠΎΠ΄ ΡΠΎΠ±ΠΎΠΉ Π½Π΅ΡΡΠΎ, ΡΡΠΎ ΠΎΠ±Π»Π°Π΄Π°Π΅Ρ ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΠ½Π½ΡΠΌ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ΠΌ ΠΈ ΡΠΏΠΎΡΠΎΠ±ΠΎΠΌ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½ΠΈΡ, ΠΎΠ±ΡΠ΅ΠΊΡ — ΡΡΠΎ ΡΠΊΠ·Π΅ΠΌΠΏΠ»ΡΡ ΠΊΠ»Π°ΡΡΠ°. ΠΠ»Π°ΡΡ ΠΌΠΎΠΆΠ½ΠΎ ΡΡΠ°Π²Π½ΠΈΡΡ Ρ ΡΠ΅ΡΡΠ΅ΠΆΠΎΠΌ, ΡΠΎΠ³Π»Π°ΡΠ½ΠΎ ΠΊΠΎΡΠΎΡΠΎΠΌΡ ΡΠΎΠ·Π΄Π°ΡΡΡΡ ΠΎΠ±ΡΠ΅ΠΊΡΡ. ΠΠ±ΡΡΠ½ΠΎ ΠΊΠ»Π°ΡΡΡ ΡΠ°Π·ΡΠ°Π±Π°ΡΡΠ²Π°ΡΡ ΡΠ°ΠΊΠΈΠΌ ΠΎΠ±ΡΠ°Π·ΠΎΠΌ, ΡΡΠΎΠ±Ρ ΠΈΡ ΠΎΠ±ΡΠ΅ΠΊΡΡ ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²ΠΎΠ²Π°Π»ΠΈ ΠΎΠ±ΡΠ΅ΠΊΡΠ°ΠΌ ΠΏΡΠ΅Π΄ΠΌΠ΅ΡΠ½ΠΎΠΉ ΠΎΠ±Π»Π°ΡΡΠΈ.
ΠΡΠ΅ ΠΎΠ±ΡΠ΅ΠΊΡΡ, Ρ ΠΊΠΎΡΠΎΡΡΠΌΠΈ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Windows Script Host, ΠΈΠΌΠ΅ΡΡ ΠΌΠ΅ΡΠΎΠ΄Ρ ΠΈ ΡΠ²ΠΎΠΉΡΡΠ²Π°. Π§ΡΠΎΠ±Ρ ΠΎΠ±ΡΠ°ΡΠΈΡΡΡΡ ΠΊ ΠΌΠ΅ΡΠΎΠ΄Ρ, Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠΊΠ°Π·Π°ΡΡ ΠΎΠ±ΡΠ΅ΠΊΡ, Π° ΡΠ΅ΡΠ΅Π· ΡΠΎΡΠΊΡ — ΠΌΠ΅ΡΠΎΠ΄ Ρ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡΠΌΠΈ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠ°ΠΌΠΈ.
ΠΠ½Π°Π»ΠΎΠ³ΠΈΡΠ½Π°Ρ ΡΠΈΡΡΠ°ΡΠΈΡ ΡΠΎ ΡΠ²ΠΎΠΉΡΡΠ²Π°ΠΌΠΈ, Π½ΠΎ ΡΠ²ΠΎΠΉΡΡΠ²Π° ΠΌΠΎΠΆΠ½ΠΎ ΠΊΠ°ΠΊ Π½Π°Π·Π½Π°ΡΠ°ΡΡ, ΡΠ°ΠΊ ΠΈ ΡΡΠΈΡΡΠ²Π°ΡΡ Π² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΠΈ Π΄ΡΡΠ³ΠΈΠ΅ ΡΠ²ΠΎΠΉΡΡΠ²Π°, ΠΏΡΠ°Π²Π΄Π°, ΡΠ»Π΅Π΄ΡΠ΅Ρ ΡΡΠΈΡΡΠ²Π°ΡΡ ΡΠΈΠΏ Π΄Π°Π½Π½ΡΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ ΠΈ ΡΠ²ΠΎΠΉΡΡΠ², ΠΈΠ½Π°ΡΠ΅ ΡΡΠ΅Π½Π°ΡΠΈΠΉ Π²ΡΠ΄Π°ΡΡ ΠΎΡΠΈΠ±ΠΊΡ Π½Π΅ΡΠΎΠ²ΠΌΠ΅ΡΡΠΈΠΌΠΎΡΡΠΈ ΡΠΈΠΏΠΎΠ² Π΄Π°Π½Π½ΡΡ .
ΠΠΎΡΡΠΎΠΈΠ½ΡΡΠ²Π° Visual Basic
Β· ΠΡΡΠΎΠΊΠ°Ρ ΡΠΊΠΎΡΠΎΡΡΡ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ Ρ Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΠΎΠΌ Π΄Π»Ρ MS Windows.
Β· ΠΡΠΎΡΡΠΎΠΉ ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡ, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡΠΈΠΉ ΠΎΡΠ΅Π½Ρ Π±ΡΡΡΡΠΎ ΠΎΡΠ²ΠΎΠΈΡΡ ΡΠ·ΡΠΊ.
Β· ΠΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΠΈ ΠΊΠ°ΠΊ Π² ΠΌΠ°ΡΠΈΠ½Π½ΡΠΉ ΠΊΠΎΠ΄, ΡΠ°ΠΊ ΠΈ Π² P-ΠΊΠΎΠ΄ (ΠΏΠΎ Π²ΡΠ±ΠΎΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΡΠ°). Π ΡΠ΅ΠΆΠΈΠΌΠ΅ ΠΎΡΠ»Π°Π΄ΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Π²ΡΠ΅Π³Π΄Π° (Π²Π½Π΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΠΎΡ Π²ΡΠ±ΠΎΡΠ°) ΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΡΠ΅ΡΡΡ Π² P-ΠΊΠΎΠ΄, ΡΡΠΎ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΠΏΡΠΈΠΎΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, Π²Π½ΠΎΡΠΈΡΡ Π·Π½Π°ΡΠΈΡΠ΅Π»ΡΠ½ΡΠ΅ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ Π² ΠΈΡΡ ΠΎΠ΄Π½ΡΠΉ ΠΊΠΎΠ΄, Π° Π·Π°ΡΠ΅ΠΌ ΠΏΡΠΎΠ΄ΠΎΠ»ΠΆΠ°ΡΡ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅: ΠΏΠΎΠ»Π½Π°Ρ ΠΏΠ΅ΡΠ΅ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΡ ΠΈ ΠΏΠ΅ΡΠ΅Π·Π°ΠΏΡΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΏΡΠΈ ΡΡΠΎΠΌ Π½Π΅ ΡΡΠ΅Π±ΡΠ΅ΡΡΡ.
Β· ΠΠ°ΡΠΈΡΠ° ΠΎΡ ΠΎΡΠΈΠ±ΠΎΠΊ, ΡΠ²ΡΠ·Π°Π½Π½ΡΡ Ρ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ΠΌ ΡΠΊΠ°Π·Π°ΡΠ΅Π»Π΅ΠΉ ΠΈ Π΄ΠΎΡΡΡΠΏΠΎΠΌ ΠΊ ΠΏΠ°ΠΌΡΡΠΈ. ΠΡΠΎΡ Π°ΡΠΏΠ΅ΠΊΡ Π΄Π΅Π»Π°Π΅Ρ Visual Basic ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Π±ΠΎΠ»Π΅Π΅ ΡΡΠ°Π±ΠΈΠ»ΡΠ½ΡΠΌΠΈ, Π½ΠΎ ΡΠ°ΠΊΠΆΠ΅ ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠΌ ΠΊΡΠΈΡΠΈΠΊΠΈ.
Β· ΠΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ Π±ΠΎΠ»ΡΡΠΈΠ½ΡΡΠ²Π° WinAPI ΡΡΠ½ΠΊΡΠΈΠΉ Π΄Π»Ρ ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΡ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΠ΅ΠΉ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ. ΠΠ°Π½Π½ΡΠΉ Π²ΠΎΠΏΡΠΎΡ Π½Π°ΠΈΠ±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ»Π½ΠΎ ΠΈΡΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ ΠΡΠ½ΠΎΠΌ ΠΠΏΠΏΠ»ΠΌΠ°Π½ΠΎΠΌ, Π½Π°ΠΏΠΈΡΠ°Π²ΡΠΈΠΌ ΠΊΠ½ΠΈΠ³Ρ «Visual Basic Programmer’s Guide to the Win32 API» .
ΠΠ΅Π΄ΠΎΡΡΠ°ΡΠΊΠΈ Visual Basic
ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌ ΡΠΎΠ»ΡΠΊΠΎ ΡΠ΅ΠΌΠ΅ΠΉΡΡΠ²Π° Windows ΠΈ Mac OS X (ΠΡΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅ — VB1 for DOS).
ΠΡΡΡΡΡΡΠ²ΠΈΠ΅ ΠΌΠ΅Ρ Π°Π½ΠΈΠ·ΠΌΠ° Π½Π°ΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ΠΈΡ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΠΈ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ². Π‘ΡΡΠ΅ΡΡΠ²ΡΡΡΠ΅Π΅ Π² ΡΠ·ΡΠΊΠ΅ Π½Π°ΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ΠΈΠ΅ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ Π½Π°ΡΠ»Π΅Π΄ΠΎΠ²Π°ΡΡ ΡΠΎΠ»ΡΠΊΠΎ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΡ, Π½ΠΎ Π½Π΅ ΠΈΡ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ.
Π’ΡΠ΅Π±ΡΠ΅Ρ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΡ msvbvmXX. dll Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ.
ΠΠ΅Π΄Π»Π΅Π½Π½Π°Ρ ΡΠΊΠΎΡΠΎΡΡΡ ΡΠ°Π±ΠΎΡΡ, ΠΎΠ±ΡΡΠ»ΠΎΠ²Π»Π΅Π½Π½Π°Ρ ΡΠ΅ΠΌ, ΡΡΠΎ ΠΏΡΠ°ΠΊΡΠΈΡΠ΅ΡΠΊΠΈ Π²ΡΠ΅ Π²ΡΡΡΠΎΠ΅Π½Π½ΡΠ΅ ΡΡΠ½ΠΊΡΠΈΠΈ ΡΠ·ΡΠΊΠ° ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Ρ ΡΠ΅ΡΠ΅Π· Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΡ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ ΠΈΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ (runtime library), ΠΊΠΎΡΠΎΡΠ°Ρ, Π² ΡΠ²ΠΎΡ ΠΎΡΠ΅ΡΠ΅Π΄Ρ, ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ ΠΌΠ½ΠΎΠ³ΠΎ «Π»ΠΈΡΠ½Π΅ΠΉ» ΡΠ°Π±ΠΎΡΡ ΠΏΠΎ ΠΏΡΠΎΠ²Π΅ΡΠΊΠ΅ ΠΈ/ΠΈΠ»ΠΈ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ ΡΠΈΠΏΠΎΠ².
ΠΡΠΈΠΌΠ΅Ρ ΠΠΎΡ ΠΏΡΠΈΠΌΠ΅Ρ Π½Π΅Π±ΠΎΠ»ΡΡΠΎΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ Π½Π° ΡΠ·ΡΠΊΠ΅ VBScript, ΠΊΠΎΡΠΎΡΠ°Ρ Π²ΡΠ²ΠΎΠ΄ΠΈΡ Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ²ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ Ρ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ΠΌ (ΡΠΈΠΌΠ²ΠΎΠ»Ρ ΠΏΠΎΡΠ»Π΅ Π·Π½Π°ΠΊΠ° Π°ΠΏΠΎΡΡΡΠΎΡΠ° ΡΠ²Π»ΡΡΡΡΡ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΡΠΌΠΈ):
' ΠΠ±ΡΡΠ²Π»Π΅Π½ΠΈΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ:
DimstrMessage
' ΠΡΠΈΡΠ²Π°ΠΈΠ²Π°Π½ΠΈΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ Π·Π½Π°ΡΠ΅Π½ΠΈΡ:
strMessage = «ΠΠ‘-09»
' ΠΡΠ²ΠΎΠ΄ ΠΎΠΊΠ½Π° Ρ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ΠΌ:
MsgBoxstrMessage
ΠΠΎ ΡΡΡΠ΅ΠΊΡΡ ΡΠ°Π±ΠΎΡΡ ΠΎΠ½Π° Π°Π½Π°Π»ΠΎΠ³ΠΈΡΠ½Π° ΠΏΡΡΠΌΠΎΠΉ ΠΈΠ½ΡΡΡΡΠΊΡΠΈΠΈ
MsgBox" ΠΠ‘-09″
ΠΠ°ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅
Π§Π°ΡΡΠΎ ΠΊΡΠΈΡΠΈΠΊΠ΅ ΠΏΠΎΠ΄Π²Π΅ΡΠ³Π°ΡΡΡΡ ΡΠ°ΠΊΠΈΠ΅ Π°ΡΠΏΠ΅ΠΊΡΡ Visual Basic, ΠΊΠ°ΠΊ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΎΡΠΊΠ»ΡΡΠΈΡΡ ΡΡΠ΅Π΄ΡΡΠ²Π° ΡΠ»Π΅ΠΆΠ΅Π½ΠΈΡ Π·Π° ΠΎΠ±ΡΡΠ²Π»Π΅Π½Π½ΡΠΌΠΈ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠΌΠΈ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ Π½Π΅ΡΠ²Π½ΠΎΠ³ΠΎ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ , Π½Π°Π»ΠΈΡΠΈΠ΅ ΡΠΈΠΏΠ° Π΄Π°Π½Π½ΡΡ «Variant». ΠΠΎ ΠΌΠ½Π΅Π½ΠΈΡ ΠΊΡΠΈΡΠΈΠΊΠΎΠ², ΡΡΠΎ Π΄Π°ΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΠΏΠΈΡΠ°ΡΡ ΠΊΡΠ°ΠΉΠ½Π΅ ΠΏΠ»ΠΎΡ ΠΎΠΉ ΠΊΠΎΠ΄. Π‘ Π΄ΡΡΠ³ΠΎΠΉ ΡΡΠΎΡΠΎΠ½Ρ, ΡΡΠΎ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ°ΡΡΠΌΠ°ΡΡΠΈΠ²Π°ΡΡ ΠΊΠ°ΠΊ ΠΏΠ»ΡΡ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ VB Π½Π΅ Π½Π°Π²ΡΠ·ΡΠ²Π°Π΅Ρ «Ρ ΠΎΡΠΎΡΠΈΠΉ ΡΡΠΈΠ»Ρ», Π° Π΄Π°ΡΡ Π±ΠΎΠ»ΡΡΠ΅ ΡΠ²ΠΎΠ±ΠΎΠ΄Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΡΡ.
ΠΡΡΡΡΡΡΠ²ΠΈΠ΅ ΡΠΊΠ°Π·Π°ΡΠ΅Π»Π΅ΠΉ, Π½ΠΈΠ·ΠΊΠΎΡΡΠΎΠ²Π½Π΅Π²ΠΎΠ³ΠΎ Π΄ΠΎΡΡΡΠΏΠ° ΠΊ ΠΏΠ°ΠΌΡΡΠΈ, ASM-Π²ΡΡΠ°Π²ΠΎΠΊ. ΠΠ΅ΡΠΌΠΎΡΡΡ Π½Π° ΡΠΎ, ΡΡΠΎ ΠΏΠ°ΡΠ°Π΄ΠΈΠ³ΠΌΠ° Visual Basic ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΡΡΠ΅Π΄Π½Π΅ΠΌΡ VB-ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΡΡ ΠΎΠ±Ρ ΠΎΠ΄ΠΈΡΡΡΡ Π±Π΅Π· Π²ΡΠ΅Π³ΠΎ ΡΡΠΎΠ³ΠΎ, ΠΏΠ΅ΡΠ΅ΡΠΈΡΠ»Π΅Π½Π½ΡΠ΅ Π²Π΅ΡΠΈ ΡΠ°ΠΊΠΆΠ΅ Π½Π΅ΡΠ΅Π΄ΠΊΠΎ ΡΡΠ°Π½ΠΎΠ²ΡΡΡΡ ΠΎΠ±ΡΠ΅ΠΊΡΠ°ΠΌΠΈ ΠΊΡΠΈΡΠΈΠΊΠΈ. Π Ρ ΠΎΡΡ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ Π½Π΅Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΠ΅ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΠΈ ΠΈ ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΠ½Π½ΡΠ΅ ΡΡ ΠΈΡΡΠ΅Π½ΠΈΡ, Π²ΡΡ ΡΡΠΎ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°ΡΡ ΠΈ Π½Π° VB (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΡΡΠ½ΠΊΡΠΈΠΉ Π΄Π»Ρ ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΈΡ ΡΠΊΠ°Π·Π°ΡΠ΅Π»Π΅ΠΉ VarPtr (), StrPtr () ΠΈ ObjPtr ()); ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ ΡΡΠΈΠΌΠΈ ΡΡΡΠΊΠ°ΠΌΠΈ Π³ΠΎΡΠ°Π·Π΄ΠΎ ΡΠ»ΠΎΠΆΠ½Π΅Π΅, ΡΠ΅ΠΌ, Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, Π½Π° Π‘ΠΈ++.
ΠΠ΄Π½Π°ΠΊΠΎ ΡΡΠΎΠΈΡ ΠΎΡΠΌΠ΅ΡΠΈΡΡ, ΡΡΠΎ Π²ΡΠ΅ Π½Π΅Π΄ΠΎΡΡΠ°ΡΠΊΠΈ ΡΠ·ΡΠΊΠ° Π²ΡΡΠ΅ΠΊΠ°ΡΡ ΠΈΠ· Π΅Π³ΠΎ ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ Π΄ΠΎΡΡΠΎΠΈΠ½ΡΡΠ²Π° — ΠΏΡΠΎΡΡΠΎΡΡ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΠ°. ΠΠΎΡΡΠΎΠΌΡ ΠΌΠ½ΠΎΠ³ΠΈΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡΡ Visual Basic Π΄Π»Ρ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΠ° ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ, Π° ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΡΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΡΠ΅Π°Π»ΠΈΠ·ΡΡΡ Π² Π²ΠΈΠ΄Π΅ Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΈ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ°Π΅ΠΌΡΡ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊ (DLL), Π½Π°ΠΏΠΈΡΠ°Π½Π½ΡΡ Π½Π° Π΄ΡΡΠ³ΠΎΠΌ ΡΠ·ΡΠΊΠ΅ (ΡΠ°ΡΠ΅ Π²ΡΠ΅Π³ΠΎ C++).
1. http://msdn.microsoft.com/en-us/library/4y5y7bh5.aspx
2. http://msdn.microsoft.com/en-us/library/1kw29xwf.aspx
3. http://www.sysengineering.ru/Administration/ScriptsForAdministration01.aspx
4. ΠΠ°Π½ ΠΠΏΠΏΠ»ΠΌΠ°Π½ Win32 API ΠΈ Visual Basic. ΠΠ»Ρ ΠΏΡΠΎΡΠ΅ΡΡΠΈΠΎΠ½Π°Π»ΠΎΠ² = Dan Appleman’s Visual Basic Programmer’s Guide to the Win32 API. — ΠΠΈΡΠ΅Ρ. — Π‘ΠΠ±.: «ΠΠΈΡΠ΅Ρ», 2001. — Π‘. 1120. — ISBN 5−272−198−2
5. ΠΡΠ°ΠΉΠ°Π½ Π‘Π°ΠΉΠ»Π΅Ρ, ΠΠΆΠ΅ΡΡ Π‘ΠΏΠΎΡΡΡ ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ Visual Basic 6. ΠΠ»Π°ΡΡΠΈΡΠ΅ΡΠΊΠΎΠ΅ ΠΈΠ·Π΄Π°Π½ΠΈΠ΅ = Special Edition Using Visual Basic 6. — Π.: «ΠΠΈΠ»ΡΡΠΌΡ», 2007. — Π‘. 832. — ISBN 0−7897−1542−2