Home > Casio > Personal Computer > Casio Z1 Gr User Manual

Casio Z1 Gr User Manual

    Download as PDF Print this page Share this page

    Have a look at the manual Casio Z1 Gr User Manual online for free. It’s possible to download the document as PDF or print. UserManuals.tech offer 338 Casio manuals and user’s guides for free. Share the user manual or guide on Facebook, Twitter or Google+.

    							  41  5.8 BASIC Command Reference 5.8.1 Format elements The method for entering statements is explained below. • Words in bold type are command or functions, and they must be entered as shown. • Braces indicate that one of the parameters enclosed must be specified. • Commas contained in braces must be written in the position shown. • Brackets indicate that the parameters enclosed may be omitted. Brackets themselves are not entered. • An asterisk indicates that the term preceding it may appear more than once. • Numeric expressions – Constants, expressions and numeric variables (e.g. 10, 10+25, A, unit cost*quantity). • String expressions – String constants, string variables and string expressions (e.g. “ABC”, A$, A$+B$). • Expressions – General term for numeric and string expressions • Arguments – Elements used by commands and functions •  Can only be executed in a program. •  Can only be executed manually. •  Can be executed both manually and in a program. •  Function instruction that can be executed both manually and in a program.  EXAMPLE: MID$ function MID$ (string array , position [ , number of characters ] )  String expression  Numeric expression  Numeric expression   The term “string expression” under “string array” describes that array. Likewise, “numeric expression” under “position” and “number of characters are descriptors. Also, since the comma and number of characters are enclosed in brackets, they may be omitted. P0 M m0 A0 F0  
    						
    							  42  5.8.2 Manual Commands  PASS    PURPOSE: Specifies or cancels a password FORMAT: PASS “password”  String expression EXAMPLE: PASS”TEXT” PARAMETERS: 1. Registering a single password makes it the password for all BASIC program areas (P0-P9) and for C language and Assembler program areas (F0-F9). 2. The password must be a string of 1-8 characters. 3. All characters after the first 8 are ignored when 9 or more characters are entered. EXPLANATION: 1. The password is used to protect programs. 2. The password can be registered in the CAL mode, BASIC mode, C mode. 3. Executing this command registers a password when no password previously exists. 4. Executing PASS statement using a previously registered password cancels the password. Specifying a password that is different from that registered results in a “PR error”. 5. The following operations and commands cannot be executed when a password is registered: - Program write - LIST, LIST ALL, LIST#, NEW, NEW ALL, NEW#, EDIT  NEW [ALL]    PURPOSE: Deletes a program. FORMAT: NEW [ALL] EXAMPLE: NEW EXPLANATION: 1. Deletes the program in the currently specified program area when ALL is omitted. Variables are not cleared. 2. “Ready Pn” is displayed on the screen after the program is deleted, and the computer stands for command input. 3. This command cannot be executed for program files that are password protected. 4. Attempting to use this command in the CAL mode results in a “FC error”. 5. Specifying NEW ALL clears the programs in all program areas and all variables. 6. This command cannot be included within a program. A0 M0  
    						
    							  43  CLEAR    PURPOSE: Clears all variables and determines the memory mapping in accordance with the parameters entered. FORMAT: CLEAR [ [strings area size] [ , assembler area size , variables area size ] ]  Numeric expression  Numeric expression  Numeric expression EXAMPLE: CLEAR CLEAR 400 CLEAR 4096,512,6144 PARAMETERS:  1. Strings area size: Determines the area used for strings. The initial setting when ALL RESET is executed is 4096. The current value can be obtained through FRE 3. 2. Assembler area size: Determines the area used for assembler programs. The initial setting when ALL RESET is executed is 0. The current value can be obtained through FRE 6. 3. Variables area size: It has to be bigger than the sum of strings and assembler area sizes to avoid a “BS Error”. The current value can be obtained through FRE 2. EXPLANATION: 1. Clear all variables 2. Strings, assembler or variables areas cannot be set during program execution. 3. If assembler area size and variable area size are omitted, these values will remain unchanged. 4. If strings area size is omitted, the CLEAR statement will clear all variables without changing memory mapping. SEE: FRE, SYSTEM  FRE    PURPOSE: Returns memory area size in accordance with argument. FORMAT: FRE argument  Numeric expression EXAMPLE: PRINT FRE 1 PARAMETERS: the argument can have the value 1-6: 1. Overall free memory (in Bytes) 2. Overall variables area size (in Bytes). FRE 2 = FRE 3 + FRE 4 3. String variables area size (in Bytes) 4. Numeric variables + assembler area size (in Bytes). FRE 4 > FRE 6 5. Free memory for string variables (in Bytes). FRE 5 
    						
    							  44  SYSTEM    PURPOSE: Shows main system status. FORMAT: SYSTEM EXAMPLE: SYSTEM  PRINT OFF   TRACE OFF CLEAR  4096,512,6144 FREE 83703 V:4096 _ EXPLANATION: Data returned by the SYSTEM statement are: 1. PRINT mode (ON/OFF) 2. TRACE mode (ON/OFF) 3. CLEAR followed by 3 numbers. These are the parameters of the last CLEAR statement entered. - First number is the memory area size in Bytes. This is what returns FRE 3. - Second number is the assembler area size in Bytes. This is what returns FRE 6 - Third is overall variables area size. This is what returns FRE 2 4. FREE followed by two numbers - Total free area in Bytes. This is what returns FRE 1 - Variables free area in Bytes. This value is inferior or equal to memory area size. This is what returns FRE 5. SEE: FRE, CLEAR  SYSTEMP    PURPOSE: Shows memory status of BASIC program areas P0-P9. FORMAT: SYSTEMP EXAMPLE: SYSTEMP  P0[     0] P1[     0] P2[     0] P3[     0] P4[     0] P5[     0] P6[     0] P7[     0] P8[     0] P9[     0] EXPLANATION: The number following each Pn is the amount of Bytes the program area is using. Value 0 shows that program area is empty.  SYSTEMF    PURPOSE: Shows memory status of file areas F0-F9. FORMAT: SYSTEMF EXAMPLE: SYSTEMF  F0[     0] F1[     0] F2[     0] F3[     0] F4[     0] F5[     0] F6[     0] F7[     0] F8[     0] F9[     0] EXPLANATION: The number following each Fn is the amount of Bytes the file area is using (BASIC file, C or assembler program). Value 0 shows that file area is empty. M m0 M m0 M m0  
    						
    							  45  LIST [ALL]    PURPOSE: Displays all or part of the currently specified program. FORMAT:   [start line number] [ - [end line number] ]  Line number  Line number LIST [.]    [ALL]     *Label      Label name     EXAMPLE: LIST LIST 100 LIST 100-300 LIST -400 LIST*Root PARAMETERS:  1. Start line number: integer in the range of 1≤ line number ≤ 65535 (first line number when omitted) 2. End line number: integer in the range of 1≤ line number ≤ 65535 (end line number when omitted) 3. Label: Name of a label in the program. EXPLANATION: 1. Displays the currently specified program in the range specified by the line numbers. 2. A minus sign must be used as a delimiter between line numbers. 3. The following five examples illustrate specification of the display range. a) LIST . . (All lines from beginning of program) b) LIST 30 . . (Line 30) c) LIST 50-100 . . (Lines 50 through 100) d) LIST 200- . . (From line 200 through end of program) e) LIST -80 . . (From beginning of program through line 80) 4. Using a period in place of the line number displays the most recently handled (i.e. written, edited, executed). If a program is halted during execution by an error, executing “LIST .”displays the line in which the error was generated. 5. When the specified start line number does not exist, the first line number above that specified is taken as the start line number 6. When the specified end line number does not exist, the greatest line number not exceeding that specified is taken as the end line number 7. The start line number must be smaller than the end line number. 8. Pressing the BRK key can halt LIST command execution. 9. Press the Shift STOP key to momentarily halt LIST command execution. To restart execution, press the . . key or one of the alphanumeric keys 10. Specifying ALL displays all programs in sequence from area P0 to P9. 11. Specifying a label name after an asterisk will list SEE: EDIT M0  
    						
    							  46  EDIT    PURPOSE: Enters the BASIC edit mode. FORMAT:  [start line number]  Line number or period EDIT [.]   *Label    Label name   EXAMPLE: EDIT 100 PARAMETERS:  1. Start line number: integer in the range of 1 ≤ line number ≤ 65535 (first line number when omitted) 2. Label: Name of a label in the program. EXPLANATION: 1. Enters the BASIC edit mode and displays the program at the specified line number, or at the specified label. The cursor is displayed and editing becomes possible with either the .. or .. key is pressed. 2. Using a period in place of the line number displays the most recently handled (i.e. written, edited, executed). If a program is halted during execution by an error, executing “EDIT .”displays the line in which the error was generated 3. When the specified start line does not exist, the first line number above that specified is taken as the start line number. 4. It is possible to change the line number in EDIT mode by using either .. or .. key. 5. This mode is cancelled by pressing the BRK key. SEE: LIST  VARLIST    PURPOSE: Displays variable names and array names. EXAMPLE: VARLIST EXPLANATION: 1. Displays all currently existing variable names and array names 2. Press the Shift STOP key to momentarily halt VARLIST command execution. To restart execution, press the . . key or one of the alphanumeric keys M0 A0  
    						
    							  47  RUN    PURPOSE: Executes a program. FORMAT:  [start line number] RUN Line number or period   *Label    Label name  EXAMPLE: RUN RUN 100 RUN*Root PARAMETERS: 1. Start line number: Interger in the rage of 1 ≤ line number ≤ 65535 2. Label: Name of a label in the program.. Entering an unknown label will generate an “UL error”. EXPLANATION: 1. Execution starts from the beginning of the program when the line number or label name is omitted. 2. When the specified start line does not exist, the first line number above that specified is taken as the start line number. 3. Variable and array values are not cleared. 4. This command cannot be used within a program. 5. This command cannot be used in the CAL mode.  TRON    PURPOSE: Specifies the trace mode. EXAMPLE: TRON EXPLANATION: 1. Switches the trace mode ON. 2. All subsequent program execution is accompanied by a display of the area name and line number. The first two lines are displayed, and execution is suspended. 3. The program stays in the TRON mode until TROFF statement is executed or the power is switched OFF SEE: TROFF  TROFF    PURPOSE: Cancels the trace mode. EXAMPLE: TROFF EXPLANATION: Cancels the trace mode (entered using the TRON statement). SEE: TRON M0 A0 A0  
    						
    							  48  5.8.3 Fundamental Commands  END    PURPOSE: Terminates program execution. EXPLANATION: 1. Terminates program execution, and the computer stands for command input 2. Closes all files that are open 3. Variables and arrays are not cleared. 4. Any number of END statements can be used in a single program. Program execution is terminated and open files are closed automatically at the end of a program even if an END statement is not included.  STOP    PURPOSE: Temporarily halts program execution. EXAMPLE: STOP EXPLANATION: 1. Temporarily halts program execution. Program area and line number of the STOP statement are displayed. Execution can be resumed by entering the CONT command or pressing Shift CONT . .. 2. Open files, variable values and array values are retained as they are at the point when execution is halted.  WAIT    PURPOSE: Pauses program execution for a certain time. FORMAT: WAIT argument  Numeric expression EXAMPLE: WAIT 100 EXPLANATION: The argument is the number of 10th of a second the program will pause before resuming its execution. This instruction is useful to slow down screen outputs that would be too fast to read. P0 P0 P0  
    						
    							  49  GOTO    PURPOSE: Branches unconditionally to a specified branch destination. FORMAT:  branch destination line number  Line number GOTO # program area number  Single character; 0-9   *Label    Label name  EXAMPLE: GOTO 1000 GOTO #7 GOTO *Finish PARAMETERS: 1. Branch destination line number: integer in the range of 1≤ line number ≤65535 2. Program area number: single character, 0-9 3. Label: Name of a label in the program. EXPLANATION: 1. Specifying a line number causes program execution to jump to that line number in the current program area. 2. Specifying a program area number causes program execution to jump to the first line number of the specified program area. 3. Specifying a label name causes program execution to jump to that label in the current program area. 4. An “UL error” is generated when the specified line number or label name does not exist. P0  
    						
    							  50  GOSUB    PURPOSE: Jumps to a specified subroutine. FORMAT:  branch destination line number  Line number GOSUB # program area number  Single character; 0-9   *Label    Label name  EXAMPLE: GOSUB 100 GOSUB #6 GOSUB *Root PARAMETERS: 1. Branch destination line number: integer in the range of 1≤ line number ≤65535 2. Program area number: single character, 0-9 3. Label: Name of a label in the program. EXPLANATION: 1. Program execution branches to the subroutine that starts at the specified line number or label. Execution is returned from the subroutine by the RETURN statement. 2. Subroutines can be nested up to 96 levels. Exceeding this value results in an “OM error” 3. An “UL error” is generated when the specified line number or label name does not exist. 4. CLEAR command cannot be used within a subroutine. SEE: RETURN  RETURN    PURPOSE: Returns execution from a subroutine to the main program. FORMAT: RETURN EXAMPLE: RETURN EXPLANATION: 1. Returns program execution to the statement immediately following the statement that originally called a subroutine. 2. A “GS error” is generated when the RETURN statement is executed without first executing a GOSUB statement. SEE: GOSUB, ON GOSUB P0 P0  
    						
    All Casio manuals Comments (0)