Network Working Group Bob Anderson Request for Comments: 138 Rand NIC 6715 Vint Cerf UCLA Eric Harslem John Heafner Rand Jim Madden U. of Illinois Bob Metcalfe MIT Arie Shoshani SDC Jim White UCSB David Wood Mitre 28 April 1971 STATUS REPORT ON PROPOSED DATA RECONFIGURATION SERVICE
CONTENTS
I. INTRODUCTION (2)
Purpose of this RFC (2)
Motivation (2)
II. OVERVIEW OF DATA RECONFIGURATION SERVICE (3)
Elements of Data Reconfiguration Service (3)
Conceptual Network Connections (3)
Connection Protocols and Message Formats (4)
Example Connection Configurations (6)
III. THE FORM MACHINE (7)
Input/Output Stream and Forms (7)
Form Machine BNF Syntax (7)
Alternate Specification of Form Machine Syntax 8
Forms (9)
Rules (10)
Terms (10)
Term Format 1 (11)
Term Format 2 (11)
Term Format 3 (13)
Term Format 4 (13)
Application of a Term (14)
Anderson, et al. [Page 1]
Restrictions and Interpretations of
Term Functions (14)
Term and Rule Sequencing (16)
IV. EXAMPLES (16)
Remarks (16)
Field Insertion (17)
Deletion (17)
Variable Length Records (17)
String Length Computation (18)
Transposition (18)
Character Packing and Unpacking (18)
V. PROPOSED USES OF DATA RECONFIGURATION SERVICE 19
VI. IMPLEMENTATION PLANS (20)
Appendix A (21)
Note 1 to the DRS Working Group (21)
Note 2 to the DRS Working Group (22)
I. INTRODUCTION
PURPOSE OF THIS RFC
The purpose of this RFC is to describe, in part, a proposed Network
experiment and to solicit comments on any aspect of the experiment.
The experiment involves a software mechanism to reformat Network data streams. The mechanism can be adapted to numerous Network
application programs. We hope that the results of the experiment
will lead to a further standard service that embodies the principles described in this RFC. We would like comments on the
appropriateness of this work as a Network experiment and also
comments on particular Network data reformatting needs that could not easily be accomplished using these techniques.
MOTIVATION
Application programs require specific data I/O formats yet the
formats are different from program to program. We take the position that the Network should adapt to the individual program requirements rather than changing each program to comply with a standard. This
position doesn’t preclude the use of standards that describe the
formats of regular message contents; it is merely an interpretation
of a standard as being a desirable mode of operation but not a
necessary one.
Anderson, et al. [Page 2]
In addition to differing program requirements, a format mismatch
problem occurs where users wish to employ many different kinds of
consoles to attach to a single service program. It is desirable to
have the Network adapt to individual console configurations rather
than requiring unique software packages for each console
transformation.
One approach to providing adaptation is for those sites with
substantial computing power to offer a data reconfiguration service;
a proposed example of such a service is described here.
The envisioned modus operandi of the service is that an applications programmer defines _forms_ that describe data reconfigurations. The service stores the forms by name. At a later time, a user (perhaps a non-programmer) employs the service to accomplish a particular
transformation of a Network data stream, simply by calling the form
by name.
We have attempted to provide a notation tailored to some specifically needed instances of data reformatting while keeping the notation and its underlying implementation within some utility range that is
bounded on the lower end by a notation expressive enough to make the experimental service useful, and that is bounded on the upper end by a notation short of a general purpose programming language.
II. OVERVIEW OF THE DATA RECONFIGURATION SERVICE
ELEMENTS OF THE DATA RECONFIGURATION SERVICE
An implementation of the Data Reconfiguration Service (DRS) includes modules for connection protocols, a handler of some requests that can be made of the service, a compiler and/or interpreter (called the
Form Machine) to act on those requests, and a file storage module for saving and retrieving definitions of data reconfigurations (forms).
This section highlights connection protocols and requests. The next section covers the Form Machine language in some detail. File
storage is not described in this document because it is transparent
to the use of the service and its implementation is different at each DRS host.
CONCEPTUAL NETWORK CONNECTIONS
There are three conceptual Network connections to the DRS, see Fig.
1.
1) The control connection (CC) is between an originating user and the DRS. A form specifying data reconfiguration is Anderson, et al. [Page 3]
defined over this connection and is applied to data passing over the two connections described below.
2) The user connection (UC) is between a user process and the DRS.
3) The server connection (SC) is between the DRS and the
serving process.
Since the goal is to adapt the Network to user and server processes, a minimum of requirements are imposed on the UC and SC.
+-------------+ CC +-----------+ SC +-----------+
| ORIGINATING +--------+ DRS +--------+ SERVER |
| USER | ^ | | ^ | PROCESS |
+-------------+ | +------+----+ | +-----------+
| / |
Telnet / <------ Simplex or Duplex
Protocol UC/ Connections
Connection /
/
+-----+-----+
| USER |
| PROCESS |
+-----------+
Figure 1. DRS Network Connections
CONNECTION PROTOCOLS AND MESSAGE FORMATS
Over a control connection the dialog is directly between an
originating user and the DRS. Here the user is defining forms or
assigning forms to connections for reformatting.
The user connects to the DRS via the initial connection protocol
(ICP) specified in NWG/RFC #80, version 1. Rather than going through a logger, the user calls on a particular socket on which the DRS
always listens. DRS switches the user to another socket pair.
Messages sent over a control connection are of the types and formats to be specified for TELNET. Thus, a user at a terminal should be
able to connect to a DRS via his local TELNET, for example, as shown in Fig. 2.
Anderson, et al. [Page 4]
+--------------+
+--------+ CC | |
+-------+ TELNET +-------+ DRS |
| +--------+ | |
| +--------------+
+----------+---------+
| USER |
|(TERMINAL OR PROGRAM|
+--------------------+
Figure 2. A TELNET Connection to DRS
When a user connects to DRS he supplies a six-character user ID (UID) as a qualifier to guarantee the uniqueness of his form names. He
will have (at least) the following commands:
1. DEFFORM (name)
2. ENDFORM (name)
These two commands define a form, the text of which is
chronologically entered between them. The (name) is six
characters. The form is stored in the DRS local file
system.
3. PURGE (name)
The named form, as qualified by the current UID, is purged from the DRS file system.
4. LISTNAMES (UID)
The unqualified names of all forms assigned to UID are
returned.
5. LISTFORM (name)
The source text of a named form is returned.
6. DUPLEXCONNECT (user site, user send, user receive,
user method, server site, server
send, server receive, server method,
user-to-server form, server-to-user form)
7. SIMPLEXCONNECT (send site, send socket, send
method, receive site, receive
socket, receive method, form)
Anderson, et al. [Page 5]
Either one, both, or neither of the two parties specified in 6 or 7
may be at the same host as the party issuing the request. Sites and sockets specify user and server for the connection. Method indicates the way in which the connection is established. Three options are
provided:
1) Site/socket already connected to DRS as a dummy
control connection. (A dummy control connection
should not also be the real control connection.)
2) Connect via standard ICP. (Only for command no. 6.)
3) Connect directly via STR, RTS.
EXAMPLE CONNECTION CONFIGURATIONS
There are basically two modes of DRS operation: 1) the user wishes to establish a DRS UC/SC connection(s) between two programs and 2) the
user wants to establish the same connection(s) where he (his
terminal) is at the end of the UC or the SC. The latter case is
appropriate when the user wishes to interact from his terminal with
the serving process (e.g., a logger).
In the first case (Fig. 1, where the originating user is either a
terminal or a program) the user issues the appropriate CONNECT
command. The UC/SC can be simplex or duplex.
The second case has two possible configurations, shown in Figs. 3 and 4.
+--------+ CC +--------+ +------+
| +------+ | SC | |
+------+ /| TELNET | UC | DRS +------+ SP |
| |/ | +------+ | | |
| USER | /+--------+ +--------+ +------+
| |/
+------+
Figure 3. Use of Dummy Control Connection
+--------+
+------+ /| USER | CC +--------+ +------+
| |/ | SIDE +------+ | SC | |
| USER | +--------+ UC | DRS +------+ SP |
| |\ | SERVING+------+ | | |
+------+ \| SIDE | +--------+ +------+
+--------+
Figure 4. Use of Server TELNET
Anderson, et al. [Page 6]
In Fig. 3 the user instructs his TELNET to make two duplex
connections to DRS. One is used for control information (the CC) and the other is a dummy. When he issues the CONNECT he references the
dummy duplex connection (UC) using the "already connected" option.
In Fig. 4 the user has his TELNET (user side) call the DRS. When he issues the CONNECT the DRS calls the TELNET (server side) which
accepts the call on behalf of the console. This distinction is known only to the user since to the DRS the configuration in Fig. 4 appears identical to that in Fig. 1. Two points should be noted:
1) TELNET protocol is needed only to define forms and direct
connections. It is not required for the using and serving
processes.
2) The using and serving processes need only a minimum of
modification for Network use, i.e., an NCP interface.
III. THE FORM MACHINE
INPUT/OUTPUT STREAMS AND FORMS
This section describes the syntax and semantics of forms that specify the data reconfigurations. The Form Machine gets an input stream,
reformats the input stream according to a form describing the
reconfiguration, and emits the reformatted data as an output stream. In reading this section it will be helpful to envision the
application of a form to the data stream as depicted in Fig. 5. An
input stream pointer identifies the position of data (in the input
stream) that is being analyzed at any given time by a part of the
form. Likewise, an output stream pointer locates data being emitted in the output stream.
/\/\ /\/\
^ | | FORM | | ^
| | | ----------------- | | |
| | | +- ----------------- -+ | | |
| | | | CURRENT PART OF | | | | INPUT | |<= CURRENT < ----------------- > CURRENT => | | OUTPUT STREAM | | POINTER | FORM BEING APPLIED | POINTER | | STREAM | | +- ----------------- -+ | |
| | ----------------- | |
| | ----------------- | |
| | ----------------- | |
\/\/ \/\/
Figure 5. Application of Form to Data Streams
Anderson, et al. [Page 7]
FORM MACHINE BNF SYNTAX
form ::= rule | rule form
rule ;;= label inputstream outputstream ;
label ::= INTEGER |
inputstream ::= terms |
terms ::= term | terms , term
outputstream ::= : terms |
term ::= identifier | identifier descriptor |
descriptor | comparator
identifier ::= an alpha character followed by 0 to 3
alphamerics
descriptor ::= (replicationexpression , datatype ,
valueexpression , lengthexpression control)
comparator ::= (value connective value control) |
(identifier .<=>. control)
replicationexpression ::= arithmeticexpression |
datatype ::= B | O | X | E | A
valueexpression ::= value |
lengthexpression ::= # | arithmeticexpression |
connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE.
value ::= literal | arithmeticexpression
arithmeticexpression ::= primary | primary operator
arithmeticexpression
primary ::= identifier | L(identifier) | V(identifier) |
INTEGER
operator ::= + | - | * | /
literal ::= literaltype "string"
Anderson, et al. [Page 8]
literaltype ::= B | O | X | E | A
string ::= from 0 to 256 characters
control ::= : options |
options ::= S(where) | F(where) | U(where) |
S(where) , F(where) |
F(where) , S(where)
where ::= arithmeticexpression | R(arithmeticexpression)
ALTERNATE SPECIFICATION OF FORM MACHINE SYNTAX
infinity
form ::= {rule}
1
1 1 1
rule ::= {INTEGER} {terms} {:terms} ;
0 0 0
infinity
terms ::= term {,term}
1
term ::= identifier | {identifier} descriptor
| comparator
1
descriptor ::= ({arithmeticexpression} , datatype ,
1 1 1 {value} , {lengthexpression} {:options}
0 0 0 1 comparator ::= (value connective value {:options} ) |
1
(identifier .<=. value {:options} )
0 connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE. lengthexpression ::= # | arithmeticexpression
datatype ::= B | O | X | E | A
value ::= literal | arithmeticexpression
Anderson, et al. [Page 9]
infinity arithmeticexpression ::= primary {operator primary}
operator ::= + | - | * | /
primary ::= identifier | L(identifier) |
V(identifier) | INTEGER
256
literal ::= literaltype "{CHARACTER} "
literaltype ::= B | O | X | A | E
1
options ::= S(where) {,F(where)} |
1
F(where) {,S(where)} | U(where)
where ::= arithmeticexpression |
R(arithmeticexpression)
3
identifier ::= ALPHABETIC {ALPHAMERIC}
FORMS
A form is an ordered set of rules.
form ::= rule | rule form
The current rule is applied to the current position of the input
stream. If the (input stream part of a) rule fails to correctly
describe the contents of the current input then another rule is made current and applied to the current position of the input stream. The next rule to be made current is either explicitly specified by the
current term in the current rule or it is the next sequential rule by default. Flow of control is more fully described under TERM AND RULE SEQUENCING.
If the (input stream part of a) rule succeeds in correctly describing the current input stream, then some data may be emitted at the
current position in the output stream according to the rule. The
input and output stream pointers are advanced over the described and emitted data, respectively, and the next rule is applied to the now
current position of the input stream.
Application of the form is terminated when an explicit return
(R(arithmeticexpression)) is encountered in a rule. The user and Anderson, et al. [Page 10]
server connections are closed and the return code
(arithmeticexpression) is sent to the originating user.
RULES
A rule is a replacement, comparison, and/or an assignment operation
of the form shown below.
rule ::= label inputstream outputstream ;
A label is the name of a rule and it exists so that the rule may be
referenced elsewhere in the form for explicit rule transfer of
control. Labels are of the form below.
label ::= INTEGER |
The optional integer labels are in the range 0 >= INTEGER >= 9999.
The rules need not be labeled in ascending numerical order.
TERMS
The inputstream (describing the input stream to be matched) and the
outputstream (describing data to be emitted in the output stream)
consist of zero or more terms and are of the form shown below.
inputstream ::= terms |
outputstream ::= :terms |
terms ::= term | terms , term
Terms are of one of four formats as indicated below.
term ::= identifier | identifier descriptor |
descriptor | comparator
Term Format 1
The first term format is shown below.
identifier
The identifier is a symbolic reference to a previously identified
term (term format 2) in the form. It takes on the same attributes
(value, length, type) as the term by that name. Term format 1 is
normally used to emit data in the output stream.
Identifiers are formed by an alpha character followed by 0 to 3
alphameric characters.
Anderson, et al. [Page 11]
Term Format 2
The second term format is shown below.
identifier descriptor
Term format 2 is generally used as an input stream term but can be
used as an output stream term.
A descriptor is defined as shown below.
descriptor ::= (replicationexpression, datatype,
valueexpression, lengthexpression
control)
The identifier is the symbolic name of the term in the usual
programming language sense. It takes on the type, length, and value attributes of the term and it may be referenced elsewhere in the
form.
The replication expression is defined below.
replicationexpression ::= arithmeticexpression |
arithmeticexpression ::= primary | primary operator
arithmeticexpression
operator ::= + | - | * | /
primary ::= identifier | L(identifier) | V(identifier) |
INTEGER
The replication expression is a repeat function applied to the
combined data type and value expression. It expresses the number of times that the value (of the data type/value expression) is to be
repeated within the field length denoted by the data type/length
expression.
A null replication expression has the value of one. Arithmetic
expressions are evaluated from left-to-right with no precedence. (It is anticipated that this interpretation might be changed, if
necessary.)
The L(identifier) is a length operator that generates a 32-bit binary integer corresponding to the length of the term named. The
V(identifier) is a value operator that generates a 32-bit binary
integer corresponding to the value of the term named. (See
Restrictions and Interpretations of Term Functions.) The value
operator is intended to convert character strings to their numerical correspondents.
Anderson, et al. [Page 12]
The data type is defined below.
datatype ::= B | O | X | E | A
The data type describes the kind of data that the term represents.
(It is expected that additional data types, such as floating point
and user-defined types, will be added as needed.)
Data Type Meaning Unit Length
B Bit string 1 bit
O Bit string 3 bits
X Bit string 4 bits
E EBCDIC character 8 bits
A Network ASCII character 8 bits
The value expression is defined below.
valueexpression ::= value |
value ::= literal | arithmeticexpression
literal ::= literaltype "string"
literaltype ::= B | O | X | E | A
The value expression is the unit value of a term expressed in the
format indicated by the data type. It is repeated according to the
replication expression, in a field whose length is constrained by the length expression.
A null value expression in the input stream defaults to the data
present in the input stream. The data must comply with the datatype attribute, however.
A null value expression generates padding according to Restrictions
and Interpretations of Term Functions.
The length expression is defined below.
lengthexpression ::= # | arithmeticexpression |
The length expression states the length of the field containing the
value expression as expanded by the replication expression. If the
value of the length expression is less then the length implied by the expanded value expression, then the expanded value expression is
truncated, see Restrictions and Interpretations of Term Functions.
The terminal symbol # means an arbitrary length, explicitly
terminated by the value of the next term. The # is legal only in the input stream and not in the output stream.
Anderson, et al. [Page 13]
If the length expression is less than or equal to zero, the term
succeeds but the appropriate stream pointer is not advanced.
Positive lengths cause the appropriate stream pointer to be advanced if the term otherwise succeeds.
Control is defined under TERM AND RULE SEQUENCING.
Term Format 3
Term format 3 is shown below.
descriptor
It is identical to term format 2 with the omission of the identifier. Term format 3 is generally used in the output stream. It is used in the input stream where input data is to be passed over but not
retained for emission or later reference.
Term Format 4
The fourth term format is shown below.
comparator ::= (value connective value control) |
(identifier .<=. value control)
value ::= literal | arithmeticexpression
literal ::= literaltype "string"
literaltype ::= B | O | X | E | A
string ::= from 0 to 256 characters
connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE.
The fourth term format is used for assignment and comparison.
The assignment operator .<=. assigns the value to the identifier.
The connectives have their usual meaning. Values to be compared must have the same type and length attributes or an error condition arises and the form fails.
The Application of a Term
The elements of a term are applied by the following sequence of
steps.
1. The data type and value expression together specify a unit value, call it x.
2. The replication expression specifies the number of times x is to be repeated (or copied) in concatenated fashion. The value of the concatenated xs becomes, say, y of length L1. Anderson, et al. [Page 14]
3. The data type and the length expression together specify a field length of the input area (call it L2) that begins at the current stream pointer position.
4. The value of y is truncated to y’ if L1 > L2. Call the
truncated length L1’.
5. If the term is an input stream term, then the value y’ of
length L1’ is compared to the input value beginning at the current input pointer position.
6. If the values are identical over the length L1’ then the
input value of length L2 (may be greater than L1’) starting at the current pointer position in the input area, becomes the value of the term.
In an output stream term, the procedure is the same except that the
source of input is the value of the term(s) named in the value
expression and the data is emitted in the output stream.
The above procedure is modified to include a one term look-ahead
where lengths are indefinite because of the arbitrary symbol, #. Restrictions and Interpretations of Term Functions
1. Terms specifying indefinite lengths, through the use of the #
symbol must be separated by some type-specific data such as a
literal. (A literal isn’t specifically required, however. An arbitrary number of ASCII characters could be terminated by a
non-ASCII character.) # is legal only in the input stream, not in the output stream.
2. Truncation and padding is as follows:
a) Character to character (A <--> E) conversion is left
justified and truncated or padded on the right with blanks.
b) Character to numeric and numeric to numeric conversions are right-justified and truncated or padded on the left with
zeros.
c) Numeric to character conversion is right-justified and
left-padded with blanks.
3. The following are ignored in a form definition over the control
connection.
a) TAB, carriage return, etc.
b) blanks except within quotes.
c) /* string */ is treated as comments except within quotes.
4. The following defaults prevail where the term part is omitted. Anderson, et al. [Page 15]
a) The replication expression defaults to one.
b) The data type defaults to type B.
c) The value expression of an input stream term defaults to
the value found in the input stream, but the input stream
must conform to data type and length expression. The value expression of an output stream term defaults to padding
only.
d) The length expression defaults to the size of the quantity determined by replication expression, data type, and value expression.
e) Control defaults to the next sequential term if a term is
successfully applied; else control defaults to the next
sequential rule. If _where_ evaluates to an undefined
_label_ the form fails.
5. Arithmetic expressions are evaluated left-to-right with no
precedence.
6. The following limits prevail.
a) Binary lengths are <= 32 bits
b) Character strings are <= 256 8-bit characters
c) Identifier names are <= 4 characters
d) Maximum number of identifiers is <= 256
e) Label integers are >= 0 and <= 9999
7. Value and length operators product 32-bit binary integers. The
value operator is currently intended for converting A or E type decimal character strings to their binary correspondents. For example, the value of E’12’ would be 0......01100. The value
of E’AB’ would cause the form to fail.
Anderson, et al. [Page 16]
TERM AND RULE SEQUENCING
Sequencing may be explicitly controlled by including control in a
term.
control ::= :options |
options ::= S(where) | F(where) | U(where)
S(where) , F(where) |
F(where) , S(where)
where ::= arithmeticexpression | R(arithmeticexpression)
S, F, and U denote success, fail, and unconditional transfers,
respectively. _Where_ evaluates to a _rule_ label, thus transfer can be effected from within a rule (at the end of a term) to the
beginning of another rule. R means terminate the form and return the evaluated expression to the initiator over the control connection (if still open).
If terms are not explicitly sequenced, the following defaults
prevail.
1) When a term fails go to the next sequential rule.
2) When a term succeeds go to the next sequential
term within the rule.
(3) At the end of a rule, go to the next sequential
rule.
Note in the following example, the correlation between transfer of
control and movement of the input pointer.
1 XYZ(,B,,8:S(2),F(3)) : XYZ ;
2 . . . . . . .
3 . . . . . . .
The value of XYZ will never be emitted in the output stream since
control is transferred out of the rule upon either success or
failure. If the term succeeds, the 8 bits of input will be assigned as the value of XYZ and rule 2 will then be applied to the same input stream data. That is, since the complete rule 1 was not successfully applied, then the input stream pointer is not advanced.
Anderson, et al. [Page 17]
IV. EXAMPLES
REMARKS
The following examples (forms and also single rules) are simple
representative uses of the Form Machine. The examples are expressed in a term-per-line format only to aid the explanation. Typically, a single rule might be written as a single line.
FIELD INSERTION
To insert a field, separate the input into the two terms to allow the inserted field between them. For example, to do line numbering for a 121 character/line printer with a leading carriage control character, use the following form.
(NUMB.<=>.1); /*initialize line number counter to one*/
1 CC(,E,,1:F(R(99))), /*pick up control character and save
as CC*/
/*return a code of 99 upon exhaustion*/
LINE(,E,,121 : F(R(98))) /*save text as LINE*/
:CC, /*emit control character*/
(,E,NUMB,2), /*emit counter in first two columns*/
(,E,E".",1), /*emit period after line number*/
(,E,LINE,117), /*emit text, truncated in 117 byte field*/
(NUMB.<=.NUMB+1:U(1)); /*increment line counter and go to
rule one*/;;
DELETION
Data to be deleted should be isolated as separate terms on the left, so they may be omitted (by not emitting them) on the right.
(,B,,8), /*isolate 8 bits to ignore*/
SAVE(,A,,10) /*extract 10 ASCII characters from
input stream*/
:(,E,SAVE,); /*emit the characters in SAVE as EBCDIC
characters whose length defaults to the
length of SAVE, i.e., 10, and advance to
the next rule*/
In the above example, if either input stream term fails,
the next sequential rule is applied.
VARIABLE LENGTH RECORDS
Some devices, terminals and programs generate variable length
records. To following rule picks up variable length EBCDIC records Anderson, et al. [Page 18]
and translates them to ASCII.
CHAR(,E,,#), /*pick up all (an arbitrary number of)
EBCDIC characters in the input stream*/
(,X,X"FF",2) /*followed by a hexadecimal literal,
FF (terminal signal)*/
:(,A,CHAR,), /*emit them as ASCII*/
(,X,X"25",2); /*emit an ASCII carriage return*/
STRING LENGTH COMPUTATION
It is often necessary to prefix a length field to an arbitrarily long character string. The following rule prefixes an EBCDIC string with a one-byte length field.
Q(,E,,#), /*pick up all EBCDIC characters*/
TS(,X,X"FF",2) /*followed by a hexadecimal literal, FF*/
:(,B,L(Q)+2,8), /*emit the length of the characters
plus the length of the literal plus
the length of the count field itself,
in an 8-bit field*/
Q, */emit the characters*/
TS; */emit the terminal*/
TRANSPOSITION
It is often desirable to reorder fields, such as the following
example.
Q(,E,,20), R(,E,,10) , S(,E,,15), T(,E,,5) : R, T, S, Q ;
The terms are emitted in a different order.
CHARACTER PACKING AND UNPACKING
In systems such as HASP, repeated sequences of characters are packed into a count followed by the character, for more efficient storage
and transmission. The first form packs multiple characters and the Anderson, et al. [Page 19]
second unpacks them.
/*form to pack EBCDIC streams*/
/*returns 99 if OK, input exhausted*/
/*returns 98 if illegal EBCDIC*/
/*look for terminal signal FF which is not a legal EBCDIC*/
/*duplication count must be 0-254*/
1 (,X,X"FF",
2 : S(R(99))) ;
/*pick up the EBCDIC and initialize count/*
CHAR(,E,,1 : F(R(98))) , (CNT .<=. 1) ;
/*count consecutive EBCDICs like CHAR*/
2 (,E,CHAR,1 : F(3)) , (CNT .<=. CNT+1 : U(2)) ;
/*emit count and current character*/
3 : (,B,CNT,8), CHAR, (:U(1));
/*end of form*/;;
/*form to unpack EBCDIC streams*/
/*look for terminal*/
1 (,X,X"FF",
2 : S(R(99))) ;
/*emit character the number of times indicated*/
/*by the counter contents*/
CNT(,B,,8), CHAR(,E,,1) : (CNT,E,CHAR,CNT:U(1));
/*failure of form*/
(:U(R(98))) ;;
V. PROPOSED USES OF DATA RECONFIGURATION SERVICE
The following are some proposed uses of the DRS that were submitted
by the sites indicated.
UCLA
1. Pack/unpack text files.
2. Preprocessor to scan META compiler input.
3. Perhaps graphics.
MIT
1. Reformatting within file transfer service.
2. Character conversions.
3. Possible graphics service (Evans and Sutherland output
format).
4. Reformat arguments of subroutines remote to each other.
U. OF ILLINOIS
1. Dependent upon remote use of DRS for many remote
services.
SDC
1. Would be essential to data transfer in general.
Anderson, et al. [Page 20]
《VB程序设计》课程综合复习资料 一、单项选择 1.若要使标签控件显示时,不覆盖其背景内容,应设置标签控件的(D )属性。 A.BACKCOLOR B.BORDERSTYLE C.FORECOLOR D.BACKSTYLE 2.如果要在文本框中输入字符时,只显示某个字符,如星号(*),运行时,在文本框中输入的字符仍然显示出来,而不显示星号,原因可能是(B ) A.文本框的MULTILINE属性值为TRUE B.文本框的LOCKED属性值为TRUE C.文本框的MULTILINE属性值为FALSE D.文本框的LOCKED属性为FALSE 3.下列关于属性设置的叙述错误的是:(A) A.一个控件具有什么属性是VB预先设计好的,用户不能改变 B.一个控件具有什么属性是VB预先设计好的,用户可以改变 C.一个控件的属性即可以在属性窗口中设置,也可以用程序代码设置 D.一个控件的属性在属性窗口中设置,还可以利用程序代码为其设置新值 4.下列说法正确的是(C ) A.对象属性只能在“属性窗口”中设置 B.一个新的工程可以在“工程窗口”中建立 C.必须先建立一个工程,才能开始设计应用程序 D.只能在“代码窗口”中编写程序代码 5.下列关于窗体上控件的基本操作错误的是:(A ) A.下一次DEL键只能删除一个控件 B.按下一次DEL键可以同时删除多个控件
C.按住SHIFT键,然后单击每个要选择的控件,可以同时选中多个控件 D.按住ALT键,然后单击每个要选择的控件,可以同时选中多个控件 6.下列关于设置控件属性的叙述正确的是(C ) A.用户必须设置属性值 B.所有的属性值都可以由用户随意设定 C.属性值不必一一重新设置 D.不同控件的属性项都完全一样 7.如果将布尔常量值TRUE赋值给一个整型变量,则整型变量的值为(B ) A.0 B.-1 C.TRUE D.FALSE 8.下列关于控件画法的叙述错误的是(D ) A.单击一次工具箱中的控件图标,只能在窗体上画出一个相应的控件 B.按住CTRL键后单击一次工具箱中的控件图标,可以在窗体上画出多个相同类型的控件C.双击工具箱中的控件图标,所画控件的大小和位置是固定的 D.不合用工具箱中的控件工具,不可以在窗估上画出图形对象,但可以写入文字字符9.应用程序设计完成后,应将程序保存,保存的过程是(D ) A.只保存窗体文件即可 B.只保存工程文件即可 C.先保存工程文件,之后保存窗体文件 D.先保存窗体文件(或标准模块文件),之后还要保存工程文件 10.VB应用程序的运行模式是(C ) A.解释运行模式B.编译运行模式C.两者都有D.汇编模式 11.可视化编程的最大优点是(C) A.具有标准工具箱
VB 程序设计》课程综合复习资料 一、单项选择 1.若要使标签控件显示时,不覆盖其背景内容,应设置标签控件的( D )属性。 A.BACKCOLOR B.BORDERSTYLE C.FORECOLOR D.BACKSTYLE 2.如果要在文本框中输入字符时,只显示某个字符,如星号(* ),运行时,在文本框中输入的字 符仍然显示出来,而不显示星号,原因可能是( B ) A. 文本框的MULTILINE属性值为TRUE B. 文本框的LOCKED!性值为TRUE C. 文本框的MULTILINE属性值为FALSE D. 文本框的LOCKED!性为FALSE 3. 下列关于属性设置的叙述错误的是:(A) A. —个控件具有什么属性是VB预先设计好的,用户不能改变 B. 一个控件具有什么属性是VB预先设计好的,用户可以改变 C. 一个控件的属性即可以在属性窗口中设置,也可以用程序代码设置 D. —个控件的属性在属性窗口中设置,还可以利用程序代码为其设置新值 4. 下列说法正确的是(C ) A. 对象属性只能在“属性窗口”中设置 B. 一个新的工程可以在“工程窗口"中建立 C. 必须先建立一个工程,才能开始设计应用程序 D. 只能在“代码窗口”中编写程序代码 5. 下列关于窗体上控件的基本操作错误的是:( A ) A. 下一次DEL键只能删除一个控件 B. 按下一次DEL键可以同时删除多个控件 C. 按住SHIFT键,然后单击每个要选择的控件,可以同时选中多个控件 D. 按住ALT键,然后单击每个要选择的控件,可以同时选中多个控件
6. 下列关于设置控件属性的叙述正确的是(C ) A. 用户必须设置属性值 B. 所有的属性值都可以由用户随意设定 C. 属性值不必一一重新设置
第一章https://www.wendangku.net/doc/1e6177557.html,环境和程序设计初步 一.选择题 1.在Visual https://www.wendangku.net/doc/1e6177557.html,的集成开发的环境中,下面不属于该环境编程语言的是(C)。 A.VB B.C++ C. Pascal D. J# 2.在集成开发环境中有两类窗口,浮动窗口和固定窗口,下面不属于浮动窗口的是(D)。 A.工具箱窗口 B.属性窗口 C.立即窗口 D.窗体窗口 3.在https://www.wendangku.net/doc/1e6177557.html,中,在窗体上显示控件的文本,用( A )属性设置。 A. Text B. Name C. Caption D. Image 4.不论何种控件,共同具有的是什么属性( D )。 A. Text B. Name C.ForeColor D.Text 5.对于窗体,可改变窗体的边框性质的属性是(B)。 A.MaxButton B. FormBorderStyle C. Name D. Left 6.若要使标签控件显示时不要覆盖窗体的背景图案,要对(A)属性进行设置。A.BackColor B. BorderStyle C.ForeColor D.BackStyle 7.若要使命令按钮不可操作,要对(A)属性进行设置。 A. Enabled B.Visible C. BackColor D. Text 8.要使文本框中的文字不能被修改,应对(D)属性进行设置。 A. Locked B. Visible C. Enabled D. ReadOnly 9.要使当前Form1 窗体的标题栏显示“欢迎使用https://www.wendangku.net/doc/1e6177557.html,”,以下(B)语句是正确的。 A.Form1.Text=“欢迎使用V https://www.wendangku.net/doc/1e6177557.html,” B.Me. Text=“欢迎使用https://www.wendangku.net/doc/1e6177557.html,” https://www.wendangku.net/doc/1e6177557.html,=“欢迎使用https://www.wendangku.net/doc/1e6177557.html,” D.Me. Name=“欢迎使用https://www.wendangku.net/doc/1e6177557.html,” 10.当运行程序时,系统自动执行启动窗体的(A)事件过程。 A. Load B. Click C. UnLoad D. GotFocus 11.当文本框的ScrollBars属性设置了非None值,却没有效果,原因是(B)。 A.文本框没有内容 B.文本框的MulitLine属性为False C.文本框的MulitLine属性为True D.文本框的Locked属性True 12.要判断在文本框中是否按了Enter键,应在文本框的(D)事件中判断。 A. Change B. KeyDown C. Click D. KeyPress 13.在VB.NE集成环境中创建https://www.wendangku.net/doc/1e6177557.html,应用程序时,除了工具箱窗口、窗体窗口和属性窗口外,必不可少的窗口是(C)。 A.窗体布局窗口
测试题(一) 一:选择题 1)VB是一种面向对象的可视化程序设计语言,采取了()的编程机制。 A:事件驱动B:按过程顺序执行 C:从主程序开始执行D:按模块顺序执行 2)在VB中最基本的对象是(),它是应用程序的基石,是其他控件的容器。 A:文本框B:命令按钮 C:窗体D:标签 3)多窗体程序是由多个窗体组成。在缺省情况下,VB在应用程序执行时,总是把()指定为启动窗体。 A:不包含任何控件的窗体B:设计时的第一个窗体 C:包含控件最多的窗体D:命名为FRM1的窗体 4)有程序代码如下:Text1.text=”Visual Basic” 则:Text1,text和“Visual Basic”分别代表() A:对象,属性,属性B:对象,方法,属性 C:对象,属性,值D:属性,对象,值 5)VB是一种面向对象的程序设计语言,()不是面向对象系统所包含的三要素。
A:变量C:事件 C:属性D:方法 6)VB的一个应用程序至少包含一个()文件,该文件存储在窗体上使用的所有控件对象和有关的(),对象相应的()过程和()代码。 A:模块,方法,属性,程序B:窗体,属性,事件,程序 C:窗体,程序,属性,事件D:窗体,属性,事件,模块7)以下不属于VB的工作模式是()模式。 A:编译B:设计 C:运行D:中断 8)在VB集成环境创建VB应用程序时,除了工具箱窗口,窗体中的窗口,属性窗口外,必不可少的窗口是() A:窗体布局窗口B:立即窗口 C:代码窗口D:监视窗口 9)保存新建的工程时,默认的路径是() A:my documents B:VB98 C: \ D:windows 10)将调试通过的工程经“文件”菜单生成“.exe文件“编译成.exe后,将该可执行文件拿到其他机器上却不能运行的主要原因是() A:运行的机器上无VB系统B:缺少.frm窗体文件 C:该可执行文件有病毒D:以上原因都不对 11)对于窗体,下面()属性在程序运行时其属性设置不起作用。 A:maxbutton B:borderstyle C: name D:left
1.项目文件的扩展名是() A..vb B..sln C..exe D..vbproj 2.集成开发环境有两类窗口:浮动和固定,下面的()窗口不是浮动窗口。 A.工具箱B.属性 C.即时D.窗体 3.要使窗体的标题为“演示实例”,应修改窗体的()属性。 A.Caption B.Tip C.Item D.Text 4.在https://www.wendangku.net/doc/1e6177557.html,中,下面属于方法的是()。 A.Focus B.SelectedText C.LostFocus D.Keypress 5.一条语句要在下一行继续写,可用()符号作为续行符。 A.+ B.- C.空格和_ D.... 6.若要使命令按钮不可操作,要对()属性进行设置。 A.Enabled B.Visible C.BackColor D.Text 7.在https://www.wendangku.net/doc/1e6177557.html,集成环境中创建https://www.wendangku.net/doc/1e6177557.html,应用程序时,除了工具箱窗口、窗体窗口和属性窗口 外,必不可少的窗口是() A.窗体布局窗口B.立即窗口 C.代码窗口D.监视窗口 8.当运行程序时,系统自动执行启动窗体的()事件过程 A.Load B.Click C.Unload D.GotFocus 9.当文本框的ScrollBars属性设置了非None值,却没有效果,原因是() A.文本框没有内容B.文本框的MultiLine属性为False C.文本框的MultiLine属性为True D.文本框的Locked属性为True 10.若要使标签控件显示时不要覆盖窗体的背景图案,要对()属性进行设置 A.BackColor B.BorderStyle C.ForeColor D.BackStyle 11.数据类型为Long的类型标识符为()。 A.%B.&C.!D.# 12.下面()是日期型常量。 A.“5/17/12”B.5/17/12 C.#5/17/12#D.(5/17/12) 13.下面的()是合法的单精度型变量。 A.num! B.sum% C.char! D.mm# 14.下面的()是合法变量名。 A.X_yz B.123abc C.Integer D.X-Y 15.Rnd函数不可能为下列的()值。 A.0 B.1 C.0.1234 D.0.0005 16.图片框控件(PictureBox)是专门用于显示图片的控件,主要属性image用于设置显示 在控件上的图片,使用()语句可以在程序中消除已装入的图片。 A.PictureBox控件名.image=”” B.PictureBox控件名.image=Nothing C.PictureBox控件名.image=Image.FromFile(“”) D.PictureBox控件名.image=Image.FromFile(Nothing) 17.表达式16/4-2^5*8/4Mod5\2的值为() A.14 B.4 C.20 D.2 18.表达式Len(“123程序设计ABC”)的值是() A.10 B.14 C.20 D.17 19.为了给x,y,z三个整型变量赋初值1,正确的赋值语句是()。 A.x=1:y=1:z=1 B.x=1,y=1,z=1
1. 若要使标签控件显示时不覆盖其背景内容,要对( )属性进行设置. A.BackColor B.BorderStyle C.ForeColor D.BackStyle 2."在窗体上建立了多个控件,如TEXT、LABEL1、COMMAND1,若要使程序一运行焦点就定位在COMMAND1控件上,应将COMMAND1控件的( )设置为0." A.INDEX B.TABINDEX C.TABSTOP D.ENABLED 3."要使一个图片框控件能自动地附着在窗体的一条边上,应设置它的( )属性." A.Picture B.Alignment C.Border D.Align 4.引用列表框的最后一项应使用( ). A.List1.List(List1.ListCount-1) B.List1.List(List1.ListCount) C.List1.List(ListCount) D.List1.List(ListCount-1) 5.要清除组合框Combol中的所有内容,可以使用( )语句. https://www.wendangku.net/doc/1e6177557.html,bo1.Cls https://www.wendangku.net/doc/1e6177557.html,bo1.Clear https://www.wendangku.net/doc/1e6177557.html,bo1.Delete https://www.wendangku.net/doc/1e6177557.html,bo1.Remove 6.下列选项中不正确的是(). A.每个菜单项都是一个对象,所以也有属性和事件. B,菜单项的属性可以在属性窗口中设计. C.每个菜单项都只有一个Click事件. D.菜单编辑器中,标题可不输入,而名称必须输入 7.如果在窗体上已经创建了一个文本框对象Text1,可以通过()事件获得输入键值的ASCII码. Change LostFocus KeyPress GotFocus 8.下列控件中,没有Caption属性的是(). 框架列表框复选框单选按钮 9.在下列说法中,正确的是(). 通过适当的设置,可以在程序运行期间让定时器显示在窗体上 在列表框中不能进行多项选择容器内不能有容器对象框架也有Click和DblClick 事件 10.在下面关于窗体的叙述中,错误的是(). 在窗体的整个生命周期中,Initialize事件只触发一次在用Show显示窗体时,不一定发生Load 事件每当窗体需要重画时,肯定会触发Paint事件Resize事件是在窗体的大小有所改变时被触发 11.要在图片框P1中打印字符串"HowAreYou",应使用语句(). Picture1.Print="HowAreYou" P1.Picture=LoadPicture("HowAreYou") P1.Print"HowAreYou" Print"HowAreYou" 12."为了在按下回车键时执行某个按钮的事件过程,需要把该命令按钮 的一个属性设置为True,这个属性是()." Value Cancle Enable Default
09生工类vb综合练习题第一套 满分:119分 姓名:________ 1、单项选择题(本题共计104分) 1、能被对象所识别的动作与可执行的活动分别称为对象的________。( ) A、方法、事件 B、事件、方法 C、事件、属性 D、过程、方法 2、以下关于事件的说法,正确的是________。( ) A、事件是由系统预先定义好的,能够被对象识别的动作 B、用户可以根据需要建立新的事件 C、事件的名称是可以改变的,由用户预先定义 D、不同类型的对象所能识别的事件一定不相同 3、VisualBasic中的工程文件的扩展名是____________。( ) A、.reg B、.frm C、.bas D、.vbp 4、VisualBasic中的标准模块文件的扩展名是____________。( ) A、.reg B、.frm C、.bas D、.vbp 5、VisualBasic中的窗体文件的扩展名是____________。( ) A、.reg B、.frm C、.bas D、.vbp 6、________是接收用户鼠标或键盘输入的能力。当对象具有____________时,可接受用户的输入。( ) A、事件 B、属性 C、焦点 D、对象 7、所谓____________就是使某个对象进入活动状态(又称激活)的一种操作或动作。( ) A、事件 B、属性 C、方法 D、对象 8、将调试通过的工程经“文件”菜单的“生成.exe文件”编译成.exe后,将该可执行文件到
其他机器上不能运行的主要原因是____________。( ) A、运行的机器上无VB系统 B、缺少.frm窗体文件 C、该可执行文件有病毒 D、以上原因都不对 9、________在用户的应用程序执行期间发生,比如鼠标单击或敲击键盘。( ) A、方法 B、属性 C、事件 D、工程 10、VB的使用目的是________________________。( ) A、开发Windows应用程序 B、图像处理 C、制作WA V文件 D、文字处理 11、VisualBasic是一种面向________的程序设计语言。( ) A、过程 B、用户 C、方法 D、对象 12、下面________语句,可以将列表框List1中当前选定的列表项的值替换成“ABC”。( ) A、List1.AddItem“ABC”,List1.ListIndex B、List1.Text=“ABC” C、List1.List(List1.ListIndex)=“ABC” D、前三项均可 13、下面所列的控件属性中,其值既能在程序设计时设定,又能在程序运行时通过赋值改变的是________。( ) A、List1.ListCount B、Text1.Index C、Dir1.Path D、Label1.Visible 14、在VB中,下列关于控件的属性或方法中,搭配错误的有________个。 ①Timer1.Interval ②List1.Cls ③Text1.Print ④List1.RemoveItem ⑤Vscroll1.Value ⑥Picture1.Print ( ) A、0 B、1 C、2 D、3 15、单选按钮(OptionButton)用于一组互斥的选项中。若一个应用程序包含多组互斥条件,可在不同的________中安排适当的单选按钮,即可实现。( )
1.vb 中的坐标圆点位于(). A:容器右上角 B:容器左上角 C:容器正中央 D:容器右下角 2.INT(100*RND(1))产生的随机整数的闭区间是(). A:[0,99] B:[1,100] C:[0,100] D:[1,99] 3.vb 应用程序是分层管理的,其最高的层次为(). A:工程 B:模块 C:窗体 D:过程 4.窗体的Caption属性的作用是(). A:确定窗体的名称 B:确定窗体的标题 C:确定窗体的边界类型 D:确定窗体的字体 5.窗体的Enable属性的属性值是()类型的数据. A:整型 B:字符型 C:逻辑型 D:实型 6. ()对象具有Clear方法. A:图片框 B:窗体 C:复选框 D:列表框 7.VisualBasic集成环境的大部分窗口都可以从主菜单项()的下拉菜单中找到相应的打开命令. A:编辑 B:视图 C:格式 D:调试 8.RGB 函数通过红.绿.蓝三基色混合产生某种颜色,某语法为RGB(红.绿.蓝),括号中红、绿、蓝三基色的成分使用0~255之间的整数.若使用三个滚动条分别输入三种基色,为保证输入数值有效,则应设置()属性. A:Max和Min B:Smallchange和 LargeChange C:Scroll和Change D:Value 9.vb 中的坐标系最小刻度为(). A:缇 B:象素 C:厘米 D:一个标准字符宽度 10. ()对象不能作为控件的容器. A:Form B:PictureBox C:Shape D:Frame 11.Rnd函数不可能产生的()值. A:0 B:1 C:0.1234 D:.00005 12.表达式Mid("SHANGHAI",6,3)的值是(). A:SHANGH B:SHA C:ANGH D:HAI 13.求以10 为底X 的常用对数的表达式为(). A:LOG(X)/LOG(10) B:LN(X) C:LOG(X)/LOG(E) D:LOG(X) 14.标准工具箱中的控件(). A:数目是固定不变的 B:数目可以增加或减少 C:包含了VisualBasic所有控件 D:在窗体建立对象时不一定被使用 15.语句listl.removeitem 1 将删除list.listindext等于()的项目.. A:0 B:2 C:3 D:1 16.Interger类型的变量可存的的最大整数是(). A:250 B:256 C:32768 D:32767 17.产生[10,37]之间的随机整数的VisualBasic表达式是(). A:In t(Rnd(1)*27)+10 B:Int(Rnd(1)*28)+10 C:Int(Rnd(1)*27)+11 D:Int(Rnd(1)*28)+11 18.表达式X+1>X是(). A:算术表达式 B:非法表达式 C:字符表达式 D:关系表达式 19.表达式INT(8*SQR(36)*10^(-2)*10+0.5)/10的值是(). A:0.48 B:0.048 C:.5 D:.05 20.如果将布尔常量值TRUE赋值给一个整型变量,则整型变量的值为(). A:0 B:-1 C:True D:FALSE 21.语句PRINT"SGN(-26)=";SGN(-26)的输出结果为().
在 VB 程序设计中,响应对象的外部动作称为 _____,而对象 可以执行的动作或对象本身的行为则称为 _____。 (A )方法,事件 (B )事件,方法 (C )属性,方法 (D )过程,事件 您的答案为:B 参考答案为:B 在VB6.0集成开发环境中不能完成的工作是_____。 (A )输入和编辑源程序 (B )编译生成可执行程序 (C )调试运行程序 (D )自动查找并改正程序中的错误 您的答案为:D 参考答案为:D VB6.0集成开发环境不包括_____。 (A )DOS 界面窗口 (B )窗体窗口 (C )代码窗口 (D )属性窗口 您的答案为:A 参考答案为:A 当运行程序时,系统自动执行启动窗体的_________事件过程。 (A )Load (B )Click (C )Unload (D )GotFocus 您的答案为:A 参考答案为:A 用一个程序段对一对象被单击(或双击)作出响应,从而实现指定的操作,称为______。 (A )可视画化程序设计 (B )事件驱动编程机制 (C )过程化程序实际方法 (D )非过程化程序设计语言 您的答案为:B 参考答案为:B Visual Basic 有三种工作模式,它们分别是______模式。 (A )设计、编译和运行 (B ) 设计、运行和中断 (C ) 设计、运行和调试 (D ) 编译、运行和调试 您的答案为:B 参考答案为:B Visual Basic 的一个应用程序至少包含一个_______文件,该文件存储窗体上使用的所有控件对象和有关的_______、对象相应的_______过程和_______代码。 (A )模块、方法、事件、程序 (B )窗体、属性、事件、程序 (C )窗体、程序、属性、事件 (D )窗体、属性、事件、模块
1.项目文件的扩展名是() A. .vb B..sln C..exe D..vbproj 2.集成开发环境有两类窗口:浮动和固定,下面的()窗口不是浮动窗口。 A.工具箱 B.属性 C.即时 D.窗体 3.要使窗体的标题为“演示实例”,应修改窗体的()属性。 A.Caption B.Tip C.Item D.Text 4.在https://www.wendangku.net/doc/1e6177557.html,中,下面属于方法的是()。 A.Focus B.SelectedText C.LostFocus D.Keypress 5.一条语句要在下一行继续写,可用()符号作为续行符。 A.+ B.- C.空格和 _ D. ... 6.若要使命令按钮不可操作,要对()属性进行设置。 A.Enabled B.Visible C.BackColor D.Text 7.在https://www.wendangku.net/doc/1e6177557.html,集成环境中创建https://www.wendangku.net/doc/1e6177557.html,应用程序时,除了工具箱窗口、窗体窗口和属性窗口 外,必不可少的窗口是() A.窗体布局窗口 B.立即窗口 C.代码窗口 D.监视窗口 8.当运行程序时,系统自动执行启动窗体的()事件过程 A.Load B.Click C.Unload D. GotFocus 9.当文本框的ScrollBars属性设置了非None值,却没有效果,原因是() A.文本框没有内容 B.文本框的MultiLine属性为False C.文本框的MultiLine属性为True D.文本框的Locked属性为True 10.若要使标签控件显示时不要覆盖窗体的背景图案,要对()属性进行设置 A.BackColor B. BorderStyle C.ForeColor D. BackStyle 11.数据类型为Long的类型标识符为()。 A.% B. & C.! D. # 12.下面()是日期型常量。 A.“5/17/12” B.5/17/12 C.#5/17/12# D.(5/17/12) 13.下面的()是合法的单精度型变量。 A.num! B.sum% C.char! D.mm# 14.下面的()是合法变量名。 A.X_yz B.123abc C.Integer D.X-Y 15.Rnd函数不可能为下列的()值。 A.0 B.1 C.0.1234 D.0.0005 16.图片框控件(PictureBox)是专门用于显示图片的控件,主要属性image用于设置显示 在控件上的图片,使用()语句可以在程序中消除已装入的图片。 A.PictureBox控件名.image=”” B.PictureBox控件名.image=Nothing C.PictureBox控件名.image=Image.FromFile(“”) D.PictureBox控件名.image=Image.FromFile(Nothing) 17.表达式16/4-2^5*8/4 Mod 5\2的值为() A.14 B.4 C.20 D.2 18.表达式Len(“123程序设计ABC”)的值是() A.10 B.14 C.20 D.17 19.为了给x,y,z三个整型变量赋初值1,正确的赋值语句是()。 A.x=1: y=1: z=1 B.x=1,y=1,z=1
安徽大学计算机教学平台VB选择题作业1到4
在 VB 程序设计中,响应对象的外部动 作称为_____,而对象可以执行的动作 或对象本身的行为则称为_____。 (A )方法,事 件 (B )事件,方法 (C )属性,方 法 (D )过程,事件 您的答案 为:B 参考答案为:B 在VB6.0集成开发环境中不能完成的工作 是_____。 (A )输入和编辑源程序 (B )编译生成可执行程序 (C )调试运行程序 (D )自动查找并改正程序中的错误 您的答案为:D 参考答
案为:D VB6.0集成开发环境不包括_____。 (A)DOS界面窗口(B)窗体窗口(C)代码窗口(D)属性窗口 您的答案为:A 参考答 案为:A 当运行程序时,系统自动执行启动窗体的 _________事件过程。 (A)Load (B)Click (C)Unload (D)GotFocus 您的答案为:A 参考答 案为:A 用一个程序段对一对象被单击(或双击) 作出响应,从而实现指定的操作,称为______。
(A)可视画化程序设计(B)事件驱动编程机制 (C)过程化程序实际方法(D)非过程化程序设计语言 您的答案为:B 参考答 案为:B Visual Basic有三种工作模式,它们分 别是______模式。 (A)设计、编译和运行(B)设计、运行和中断 (C)设计、运行和调试(D)编译、运行和调试 您的答案为:B 参考答 案为:B Visual Basic的一个应用程序至少包含 一个_______文件,该文件存储窗体上使用的所有控件对象和有关的_______、对象相应的_______过程和_______代码。(A)模块、方法、事件、程序 (B)窗体、属性、事件、程序
模拟试题三 一、单选题 1. Visual Basic是一种面向对象的可视化程序设计语言,采取了 A 的编程机制。 (A) 事件驱动 (B) 按过程顺序执行 (C) 从主程序开始执行 (D) 按模块顺序执行 2. 若要使标签控件显示时不覆盖其背景内容,要对 D 属性进行设置。 (A) Backcolor (B) BorderStyle (C) Forecolor (D) Backstyle 3. 在Visual Basic中最基本的对象是 C ,它是应用程序的基石,是其他控件的容器。 (A) 文本框 (B) 命令按钮 (C) 窗体 (D) 标签 4. 要判断在文本框是否按下Enter键,应在文本框的 B 事件中判断。 (A) Change (B)KeyDown (C) Click (D)KeyPress 5. 数学表达式3≤x
《VB程序设计》复习题 第一部分概述 一、填空题 1、Visual Basic是一种面向__________的可视化程序设计语言,采取了__________的编程机制。 2、在VB中工程文件的扩展名是____________,窗体文件的扩展名是____________,标准模块文件的扩展名是____________。 3、执行“工程”菜单下的__________命令,可选择并添加ActiveX控件。 4、Visual Basic 6.0用于开发__________环境下的应用程序。 二、选择题 1、下面不是VB工作模式的是() A.设计模式B.运行模式C.汇编模式D.中断模式 2、可视化编程的最大优点是() A.具有标准工具箱 B.一个工程文件由若干个窗体文件组成 C.不需要编写大量代码来描述图形对象 D.所见即所得 3、下列不能打开属性窗口的操作是() A.执行“视图”菜单中的“属性窗口”命令 B.按F4键C.按Ctrl+T D.单击工具栏上的“属性窗口”按钮 4、下列可以打开立即窗口的操作是() A.Ctrl+D B.Ctrl+E C.Ctrl+F D.Ctrl+G 5、Visual Basic的编程机制是() A.可视化B.面向对象C.面向图形D.事件驱动 三、简答题
1、代码窗口主要包括哪几部分? 2、在工程资源管理器窗口中,主要列出了哪三类文件? 第二部分简单程序设计 一、填空题 1、设置是否可以用Tab键来选取命令按钮,应该用______________属性。 2、一个控件在窗体的位置由_______和________属性决定,其大小由__________和_________属性决定。 3、利用对象的属性setfocus可获得焦点,对于一个对象,只有其visible属性和____________属性为true,才能接受焦点。 4、设置控件背景颜色的属性名称是______________________。 5、所有控件都具有的共同属性是__________________属性。 6、一般情况下,控件有两个属性项的缺省值是相同的,这两个属性项是_______________。 7、VB中的每个对象(控件)都有一组特征,这组特征称为__________,我们通过修改它可以控制对象的外观和操作。 8、通常情况下,VB中一个工程主要包括如下四个文件:窗体文件、工程文件、类模块文件和_____________文件,后者的扩展名为.Bas,通常由Basic语言编写,是一个可共用的子程序。 9、VB有三种工作模式,分别是设计(Design)模式、_____________和中断(Break)模式。 二、选择题 1、以下能够触发文本框Change事件的操作是() A.文本框失去焦点B.文本框获得焦点 C.设置文本框的焦点D.改变文本框的内容 2、应用程序设计完成后,应将程序保存,保存的过程是() A.只保存窗体文件即可 B.只保存工程文件即可 C.先保存工程文件,之后保存窗体文件 D.先保存窗体文件(或标准模块文件),之后还要保存工程文件
简单VB程序设计 对于窗体,下面______属性在程序运行时其属性设置起作用。(A)MaxButton(B)BorderStyle(C)Name(D)Left 类是对象的抽象,对象则是类的具体化。在窗体上建立的一个控件称为______。(A)对象(B)容器(C)实体(D)类 若要使标签控件显示时不覆盖其背景内容,要对______属性进行设置。(A)BackColor(B)BorderStyle (C)ForeColor(D)BackStyle 用一个程序段对一对象被单击(或双击)作出响应,从而实现指定的操作,称为______。(A)可视画化程序设计(B)事件驱动编程机制(C)过程化程序实际方法(D)非过程化程序设计语言 文本框没有______属性。(A)Enabled(B)Visible(C)BackColor(D)Caption 不论何控件,共同具有的是______属性。(A)Text(B)Name(C)ForeColor(D)Caption 要使Form1窗体的标题栏显示"欢迎使用VB",以下______语句是正确的。(A)Form1.Caption=“欢迎使用VB”(B)Form1.Caption='欢迎使用VB'(C)Form1.Caption=欢迎使用VB(D)Form1.Caption="欢迎使用VB" 要使某控件在运行时不可显示,应对______属性进行设置。(A)Enabled(B)Visible(C)BackColor (D)Caption 要使窗体在运行时不可改变窗体的大小和没有最大化和最小化按钮,只要对下列______属性设置就有效。(A)MaxButton(B)BorderStyle(C)Width(D)MinButton 当运行程序时,系统自动执行启动窗体的______事件过程。(A)Load(B)Click(C)UnLoad(D)GotFocus 当文本框的ScrollBars属性设置了非零值,却没有效果,原因是______。(A)文本框中没有内容(B)文本框的MultiLine属性为False(C)文本框的MultiLine属性为True(D)文本框的Locked属性为True 要判断在文本框是否按了Enter键,应在文本框的______事件中判断。(A)Change(B)KeyDown(C)Click(D)KeyPress 将调试通过的工程经"文件"菜单的"生成.exe文件"编译成.exe后,将该可执行文件到其他机器上不能运行的主要原因是______。(A)运行的机器上无VB系统(B)缺少.frm窗体文件(C)该可执行文件有病毒(D)以上原因都不对 当需要上下文帮助时,选择要帮助的"难题",然后按______键,就可出现MSDN窗口及显示所需"难题"的帮助信息。(A)Help(B)F10(C)Esc(D)F1 Visual Basic有三种工作模式,它们分别是______模式。 (A)设计、编译和运行(B)设计、运行和中断 (C)设计、运行和调试(D)编译、运行和调试 CADBD BDBBA BDABD VB语言基础之一 下面______是不合法的整型常数。 (A)123%(B)123& (C)&O123(D)%123 下列函数中______,函数返回的值是数值型的。 (A)Instr(B)Mid (C)Space(D)Chr 一个变量要保存-32786,不应定义成______型变量
第一章VB、NET环境与程序设计初步 一、选择题 1、在Visual Studio、NET的集成开发的环境中,下面不属于该环境编程语言的就是(C)。 A、VB B、C++ C、Pascal D、J# 2、在集成开发环境中有两类窗口,浮动窗口与固定窗口,下面不属于浮动窗口的就是(D)。 A、工具箱窗口 B、属性窗口 C、立即窗口 D、窗体窗口 3、在VB、NET中,在窗体上显示控件的文本,用( A )属性设置。 A、Text B、Name C、Caption D、Image 4、不论何种控件,共同具有的就是什么属性( D )。 A、Text B、Name C.ForeColor D.Text 5.对于窗体,可改变窗体的边框性质的属性就是(B)。 A、MaxButton B、FormBorderStyle C、Name D、Left 6、若要使标签控件显示时不要覆盖窗体的背景图案,要对(A)属性进行设置。 A.BackColor B、BorderStyle C.ForeColor D、BackStyle 7.若要使命令按钮不可操作,要对(A)属性进行设置。 A、Enabled B、Visible C、BackColor D、Text 8、要使文本框中的文字不能被修改,应对(D)属性进行设置。 A、Locked B、Visible C、Enabled D、ReadOnly 9、要使当前Form1 窗体的标题栏显示“欢迎使用VB、NET”,以下(B)语句就是正确的。 A、Form1、Text=“欢迎使用V B、NET” B、Me、Text=“欢迎使用VB、NET” C、Form1、Name=“欢迎使用VB、NET” D、Me、Name=“欢迎使用VB、NET” 10、当运行程序时,系统自动执行启动窗体的(A)事件过程。 A、Load B、Click C、UnLoad D、GotFocus 11、当文本框的ScrollBars属性设置了非None值,却没有效果,原因就是(B)。 A、文本框没有内容 B、文本框的MulitLine属性为False C、文本框的MulitLine属性为True D、文本框的Locked属性True 12.要判断在文本框中就是否按了Enter键,应在文本框的(D)事件中判断。 A、Change B、KeyDown C、Click D、KeyPress 13、在VB、NE集成环境中创建VB、NET应用程序时,除了工具箱窗口、窗体窗口与属性窗口外,必不可少的窗口就是(C)。 A.窗体布局窗口 B. 立即窗口 C. 代码窗口 D.监视窗口 14.当创建一个项目名为“引例”的项目时,该项目的所有代码文件将保存在(C)文件夹下。 A.My Documents B.VB、NET C.\引例 D.Windows 15.将调试通过后生成的、exe 可执行文件放到其她机器上不能运行的主要原因就是(A)。 A 、运行的机器上面无VB、NET系统 B 、缺少、frm 窗体文件 C、该可执行文件有病毒
1、Visual Basic程序中分隔各语句的字符是( )。(1分) A、' B、: C、\ D、_ 2、对象的特征称( )。(1分) A、属性 B、方法 C、事件 D、过程 3、下列关于VB编码规则的叙述中,错误的是( )。(1分) B、多条语句可以书写在同一行上,每条语句 A、一条语句可以分为多行书写 之间用逗号隔开 C、可以用Rem<注释内容>给语句或程序段加上 D、不区分程序代码中变量名的字母的大小写注释,以提高可读性 4、下列叙述中正确的是( )。(1分) A、只有窗体才是Visual Basic中的对象 B、只有控件才是Visual Basic中的对象 D、窗体和控件都不是Visual Basic中的对 C、窗体和控件都是Visual Basic中的对象 象 5、有程序代码如下:Text1.Text = "郑州大学",则Text1、Text 、"郑州大学"分别代表( )。(1分) A、对象、值、属性 B、对象、方法、属性 C、对象、属性、值 D、属性、对象、值 6、对象能够执行的操作称为( )。(1分) A、属性 B、方法 C、事件 D、过程 7、如果VB语句超过一行,可以使用空格加( )续行。(1分) A、- B、+ C、; D、_
8、Visual Basic建立新工程时为用户建立第一个窗体,其默认的名字是( )。(1分) A、Form B、Form1 C、窗体 D、窗体1 9、在Visual Basic集成环境创建应用程序时,通常一定会使用窗体窗口,并一定会用到( )。(1分) A、代码窗口 B、立即窗口 C、监视窗口 D、窗体布局窗口 10、启动Visual Basic后,系统为用户新建的工程起一个名为( )的临时名称。(1分) A、工程1 B、窗体1 C、工程 D、窗体 11、在VB程序中,逐语句调试的操作键是( )。(1分) A、F8键 B、F9键 C、F2键 D、F1键 12、使用Visual Basic编程,我们把工具箱内的工具称为( )。(1分) A、事件 B、工具 C、控件 D、窗体 13、VB6.0集成开发环境中不带有( )窗口。(1分) A、DOS界面窗口 B、窗体窗口 C、工程资源管理器窗口 D、属性窗口 14、双击窗体中的对象后,VB将显示的窗口是( )。(1分) A、工程窗口 B、工具箱 C、属性窗口 D、代码窗口 15、双击窗体的任何地方,可以打开的窗口是( )。(1分) A、代码窗口 B、属性窗口