Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
script.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
38 Кб
Скачать
☆

3.1 System Variables

System variables are set by scripting commands or are determined by the information your enter when you set up a Dial-Up Networking connection. System variables are read-only, which means they cannot be changed within the script. The system variables are:

Name Type Description

$USERID String The user identification for the current connection. This variable is

the value of the user name specified in the Dial-Up Networking

Connect To dialog box.

$PASSWORD String The password for the current connection. This variable is the

value of the user name specified in the Dial-Up Networking

Connect To dialog box.

$SUCCESS Boolean This variable is set by certain commands to indicate whether or not the command succeeded. A script can make

decisions based upon the value of this variable.

$FAILURE Boolean This variable is set by certain commands to indicate

whether or not the command failed. A script can make decisions

based upon the value of this variable.

These variables may be used wherever an expression of a similar type is used. For example,

transmit $USERID

is a valid command because $USERID is a variable of type string.

4.0 String Literals

Scripting for Dial-Up Networking supports escape sequences and caret translations, as described below.

String Literal Description

^char Caret translation

If char is a value between '@' and '_', the character sequence is translated into a single-byte value between 0 and 31. For example, ^M is converted to a carriage return.

If char is a value between a and z, the character sequence is translated into a single-byte value between 1 and 26.

If char is any other value, the character sequence is not specially treated.

<cr> Carriage return

<lf> Linefeed

\" Double-quote

\^ Single caret

\< Single '<'

\\ Backslash

Examples:

transmit "^M"

transmit "Joe^M"

transmit "<cr><lf>"

waitfor "<cr><lf>"

5.0 Expressions

An expression is a combination of operators and arguments that evaluates to a result. Expressions can be used as values in any command.

An expression can combine any variable, or integer, string, or boolean values with any of the unary and binary operators in the following tables. All unary operators take the highest precedence. The precedence of binary operators is indicated by their position in the table.

The unary operators are:

Operator Type of Operation

- Unary minus

! One's complement

The binary operators are listed in the following table in their order of precedence. Operators with higher precedence are listed first:

Operators Type of Operation Type Restrictions

* / Multiplicative Integers

+ - Additive integers Strings (+ only)

< > <= >= Relational Integers

== != Equality Integers, strings, booleans

and Logical AND Booleans

or Logical OR Booleans

Examples:

count = 3 + 5 * 40

transmit "Hello" + " there"

delay 24 / (7 - 1)

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]