• Aucun résultat trouvé

CLEAR WINDOW

Dans le document BASIC Language Reference (Page 112-120)

Item Description

window number numeric expression, rounded to integer

Example Statements

CLEAR WINDOW Fred CLEAR WINDOW 604

Semantics

CLEAR WINDOW

Range 600 thru 699

This statement is only valid when running BASICjUX under X Windows. The window number must correspond to a window created with the CREATE WINDOW statement, or root BASIC window (number 600). This statement then to clears the specified window.

When not in a window system, this statement will cause an error.

Note there are three ways to clear the root BASIC window:

CLS

CLEAR SCREEN CLEAR WINDOW 600

CLIP

numeric expression in current units numeric expression in current units numeric expression in current units num.eric expression in current units

Example Statements

CMD

See the SEND statement.

CMPLX

REAL, INTEGER, or COMPLEX expressions.

~ argument ~ argument ~

Arguments used by this function are converted to two 8-byte (64-bit) floating-point values and handled accordingly. If arguments are COMPLEX, then only the real part of that COMPLEX argument is used.

COLOR

See the AREA and SET PEN statements. See the PLOTTER IS statement for "COLOR MAP".

Supported on Option Required Keyboard Executable Programmable In an IF ... THEN

WS,UX None No Yes No

COM

This statement dimensions and reserves memory for variables in a special "common"

memory area so more than one program context can access the variables.

Expanded diagram:

Item

name of a string variable integer constant;

COM /Graph/ Title$,~Device,INTEGER Points(*) COM INTEGER I,J,REAL Array(-128:127)

COM INTEGER Buf(127) BUFFER,C$[256] BUFFER

Semantics

Storage for COM is allocated at prerun time in an area of memory which is separate from the data storage used for program contexts. This reserved portion of memory remains

• Executing a GET or LOAD command that tells program execution to begin (such as LOAD "File" ,1).

When COM allocation is performed at prerun, the new program's COM area is compared to the COM area currently in memory. When comparing the old and new areas, BASIC looks first at the types and structures declared in the COM statements. If the "text"

indicates that there is no way the areas could match, then those areas are considered mismatched. If the declarations are consistent, but the shape of an array in memory does not match the shape in a new COM declaration, BASIC takes the effect of REDIM into account. If the COM areas could be matched by a REDIM, they are considered to be in agreement. When this happens, the treatment of the arrays in memory depends upon the program state. If the COM matching occurred because of a programmed LOADSUB, the arrays in memory keep their current shape. If the COM matching occurred for any other reason (such as RUN or programmed LOAD), the arrays in memory are redimensioned below), and COM statements may be interspersed between other statements. If there is an OPTION BASE statement in the context, it must appear before COM statement.

COM variables do not have to have the same names in different contexts. Formal parameters of subprograms are not allowed in COM statements. A COM mismatch between contexts causes an error.

The total number of COM elements is limited to a maximum memory usage of 224-1, or 16777215, bytes (or limited by the amount of available memory, whichever is less).

If a COM area requires more than one statement to describe its contents, COM statements defining that block may not be intermixed with COM statements defining other COM areas.

Numeric variables in a COM list can have their type specified as either REAL, INTEGER, or COMPLEX. Specifying a variable type implies that all variables which follow in the list are of the same type. The type remains in effect until another type is specified.

String variables and I/O path names are considered a type of variable and change the specified type. Numeric variables are assumed to be REAL unless their type has been changed to INTEGER or COMPLEX.

COM statements (blank or labeled) in different contexts which refer to an array or string must specify it to be of the same size and shape. The lowest-numbered COM statement containing an array or string name must explicitly specify the subscript bounds and/or string length. Subsequent COM statements can reference a string by name only or an array only by using an asterisk specifier (*).

No array can have more than six dimensions. The lower bound value must be less than or equal to the upper bound value. The default lower bound is specified by the OPTION BASE statement.

Any LOADSUB which attempts to define or change COM areas while a program is running generates ERROR 145.

Unlabeled or Blank COM

Blank COM does not contain a block name in its declaration. Blank COM (if it is used) must be created in a main context. The main program can contain any number of blank COM statements (limited only by available memory). Blank COM areas can be accessed by subprograms, if the COM statements in the subprograms agree in type and shape with the main program COM statements.

Labeled COM

Labeled COM contains a name for the COM area in its declaration. Memory is allocated for labeled COM at prerun time according to the lowest-numbered occurrence of the labeled COM statement. Each context which contains a labeled COM statement with the same label refers to the same labeled COM block.

Declaring Buffers

To declare COM variables to be buffers, each variable's name must be followed by the keyword BUFFER; the designation BUFFER applies only to the variable which it follows.

String arrays cannot be declared to be buffers.

Supported on

This statement declares COMPLEX variables and arrays and reserves storage for them.

(For information about COMPLEX as a secondary keyword, see the ALLOCATE, COM, DEF FN, or SUB statements.)

Dans le document BASIC Language Reference (Page 112-120)

Documents relatifs