e-Gadget - プログラム関数電卓 2014年08月

C.Basic Command Reference

 C.Basic - Table of Contents
< English | 日本語

Content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


- C.Basic - Introduction & Download

C.Basic is an on-calc language running on fx-9860G Series, picking the best of both Casio Basic and usability of fx-5800P. It's not only almost compatible with Casio Basic but also providing extended commands for more powerful programming. It runs much faster than the Casio Basic.


- Inside Casio Basic

For compatible commands, go to Inside Casio Basic.


- C.Basic Command Reference

* "Compatible" = compatible with Casio Basic
* "Extended"    = extended function or new command

- Basic SpecificationCompatible  Extended
Display Area
Graphics Coordinate Systems
Control of Internal Cursor Row
 
- Basic Operation CommandsCompatible  Extended
 (Substitution)
" " (Display)
(Dispplay & Pause)
? (input) [fx-5800P]
?→ (input) [fx-9860GII, fx-CG20/10]
 
- I/O CommandsCompatible  Extended
Getkey
Getkey1, Getkey2, Getkey3
Locate X,Y,<value>[,R]
LocateYX Y,X,<value>[,R]
 
- Program CommandsCompatible  Extended
If... Then... [Else]... IfEnd
If... Then... ElseIf... [Else]... IfEnd
For... To... [Step...] Next
While... WhileEnd
Do... LpWhile
Switch... Case... Default... SwitchEnd
 
- Program Control CommandsCompatible  Extended
Break
Return
Stop
Prog "<file name>"
Prog "<fle name>",x,y,z... (Pass & Return values) 
 
- Jump CommandsCompatible  Extended
Goto... Lbl
Isz
Dsz
Gosub... Lbl... Return
  
- Relational OperatorsCompatible  Extended
=, ≠, <, >, ≤, 
 
- Logical OperatorsCompatible  Extended
And, Or, Not, Nor
 
- Description CodesCompatible  Extended
: (Multi-statement Command & Display suppression)
' (Comment Text Delimiter)
'/<Command available only on C.Basic>
  
- NumbersCompatibleExtended
Type of Number
0x/0X, 0b/0B
 
- VariablesCompatible  Extended
A - Z (Capital Letter)
~
a - z (Small Letter)
#, % (double and integer variables)
Local
 
- ArrayCompatible  Extended
Dim Z / Z[ ] [fx-5800P], Dim A / A[ ]
 
- MatrixCompatible  Extended
{m,n}→Dim Mat A (Allocates Memoryx)
[[...][...]...]→Mat A (Allocates & Initializes Memory)
<number>->Mat A (Initializes & Substitute to Matrix)
<string>->Mat A (Initializes & Substitute to  Matrix)
Fill( ) (Initialize & Substitute to Matrix)
Mat A.x (x = p, b, w, l, f) (Type of Matrix)
Mat A[ ], Mat a [ ], A[ ], a[ ] (Expression of Matrix)
Mat A.v (VRAM access by 1bit Matrix)
'#Str (Handling String by Matrix)
#Mat 0, #Mat 1, Device Coordinate System
ElmSize( ), ColSize( ), RowSize( )
Save, Load( ), IsExist( ) 
Trn
 
- Bitmap CommandsCompatible  Extended
dotGet( ), dotPut( ), dotTrim( )
ReadGraph( ), WriteGraph( )
dotLife (dedicated to game of life)
 
- Display Setup (text)Compatible  Extended
Cls (Text)
ClrText (Text)
Eng
EngOn, EngOff
Norm
Sci
Fix
Deg, Rad, Gra✔
°, r (rad), g (gra), DMS✔
Rnd, RndFix( )
f, p, n, μ, m✔
k, M, G, T, P, E✔
 
- Mathematical FunctionsCompatible  Extended
Many of key-in functions✔
Abs, Int, Frac, !, MOD( )✔
sinh, cosh, tanh, sinh-1, cosh-1, tanh-1 ✔
 
- Randum NumberCompatible  Extended
Ran#, RanInt#( )
 
- StringsCompatible  Extended
Str, StrJoin( ), StrLen( ), StrCmp( ), StrSrc( )✔
StrLeft( ), StrRight( ), StrMid( )✔
Exp▶Str( ), Exp( ), StrUpr( ), StrLwr( )✔
StrInv( ), StrShift( ), StrRotate( ), \, +
Sprintf( )✔
Str( )
  
- Graphics SetupCompatible  Extended
ClrGraph
ViewWindow
Xmin, Xmax, Xdot, Xscl, Xfct
Ymin, Ymax, Yscl, Yfct
 AxesOn, AxesOff
 GridOn, GridOff
 LabelOn, LabelOff
CoordOn, CoordOff
S-L-Normal, S-L-Thick, S-L-Dot, S-L-Broken
  
- Graphics Sketch CommandsCompatible  Extended
Cls (Graphics)
ClrGraph
Text Y,X,<value>
Text Y,X,<value>[,N/R/O/V]
PxlOn Y,X
PxlOff Y,X
PxlChg Y,X
PxlTest(Y,X)
Plot
Line
PlotOn X,Y
PlotOff X,Y
F-Line X2,Y2,X1,T1
F-Line X2,Y2,X1,Y1,C/X
Vertical X
Vertical X,C/X
Horizontal Y
Horizontal Y,C/X
Circle X,Y,R
Circle X,Y,R,C/X
SketchNormal, SketchThick, SketchDot, SketchBroken
StoPict, RclPict
Rect, FillRect
FKeyMenu(<n>,<string>[,R])
PutDispDD
Screen
 
- Graph
Y
Graph Y=
DrawGraph
 
- Timer CommandCompatible  Extended
%, Ticks✔
 
- Debug CommandCompatible  Extended
ACBreak
 
- VRAM
RefreshCtrl, RefreshTime
Screen, PutDispDD
 
- Function Key Menu
FkeyMenu( )
 
- Excute ModeCompatible  Extended
'#CBINT, "#CBint
'#CBASIC, '#CBasic, '#CBDBL, '#CBdbl
 
- Hardware ControlCompatible  Extended
 Backlight
 
- Machine Language Commands
SysCall( ), Call( )
Peek( ), Poke()
ValPr( ), ProgPr( )
 
  






Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.



関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

VRAM Access by 1bit Matrix

 VRAM Access by 1bit Matrix
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Description

i. C.Basic provides a unique matrix to directly access VRAM. The unique marix is a 1 bit matrix and an element Exy directly corresponds to
an(x, y) pixel data of VRAM. The (x, y)  is a coorinate in Device Coorinates System of VRAM. Left-TOP pixel is in coorinate (1, 1) and right-bottom pixel is in coordinate (127, 63)

ii. When the VRAM access matrix is allocated, the matrix data corresponds to VRAM bitmap data. 


Syntax

1. Allocation: {127,63}→Dim Mat A.v or {127,63}→Dim Mat A.V
2. Matrix expression: Mat A[] ~ Mat Z[], Mat a[] ~ Mat z[]A[] ~ Z[], a[] ~ z[]
3. Value of the matrix is 0 (zero) or 1 (one).
4. A value A[x,y] = Exy corresponds to a pixel data (0 or 1) in coordinate (column x, row y) of VRAM.


Note

Example 1

    ClrGraph
    For -1→Y To 1 Step 0.1
        PlotOn 0,Y
    Next
    {127,63}→Dim Mat A.v
    0→P
    For 1→Y To 63
        For 1→X To 127
            P+A[X,Y]→P
        Next
    Next
    Locate 1,1,P


This code display as follows;

    21

{127,63}→Dim Mat A.v sets bitmap data of VRAM in Mat A. When a graphics command is processed automatically the VRAM bitmap reflected to the Mat A.

This code draws 21 dots at first then define Mat A.v. At this time the Mat A is directly reflected to bitmap data of VRAM. An element of the Mat A is 0 or 1, 

After allocating the Mat A, interestingly this matrix has already bitmap data of VRAM. Then calculating summary of all the elements should be a number of drawn dots. The dysplayed result shows the number of total drawn dots is 21.


Example 2

Exampl 1 is a sample to read out VRAM bitmap data. This Example 2 is to reflect VRAM bitmap data to LCD screen.

    ClrGraph
    Screen.G
    {127,63}→Dim Mat A.v
    For 53→X To 73
        1→A[X,31]
    Next
    PutDispDD

Before running a graphics drawing command, automatically text screen is selected, then swap to graphics screen by Screen.G. Mat A is allocated after ClirGraph then every element of the matrix is 0. Following code sets 21 pixels to 1. PutDispDD command transfers the VRAM data to LCD screen.
 



See also: Type of Matrix, PutDispDD, Screen

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

Expression of Matrix (C.Basic)

 Expression of Matrix
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Description

i. A standard expression of matrix is Mat A[ ] which also can be used in Casio Basic.

ii. C.Basic provides an extended expresison using a small letter for matrix, like Mat a[ ]

iii. C.Basic provides a shorter expression for matrix, like A[ ], a[ ], &A[ ] or $a[ ].

iv. Be carefle about using tis
 abbreviated expression.  
     Instead of following standard expression;
    {<row>,<column>}→Dim Mat A 
    [[<E11>,<E12>,...][<E21,E22>,...]...]→Mat a.
    Mat A→Dim Mat A.x (x = p, v, b, l, f)

   those below cannot be used;
     {<row>,<column>}→Dim A
    [[<E11>,<E12>,...][<E21>,<E22>,...]...]→a.
    A→Dim A.x (x = p, v, b, l, f)


Note

Example 1

    [[1,2,3,4][5,6,7,8]]→Mat A.b
    Locate 1,1,ElmSize(A)
    Mat A→Dim Mat A.w
    Locate 1,2,ElmSize(A) 

This code display as follows;

    8
    16

The first and third line cannot be converted to abbreviated expression. But the second and fourth line use shorter expresison of Mat A.




See also: 

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

Type of Matrix (C.Basic)

 Type of Matrix
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Description

i. C.Basic provides deferent type of matrix; a bit integer type, a byte integer (8bit) type, a word integer (16bit) type, a long integer (32bit) type and a double real number (64bit) type. 


ii. Those smaller bit type of matrix helps to save allocated memory size. This feature gives faster matrix access, handling bitmap data and direct access to VRAM.


Syntax

1. Mat A.p / Mat A.P defines as a bit type (1 bit)
2. Mat A.v / Mat A.V defines as a bit type for direct access to VRAM (1 bit)
3. Mat A.b / Mat A.B defines as a byte type (8 bit, byte integer)
4. Mat A.w / Mat A.W defines as a word type (16 bit, word integer)
5. Mat A.l / Mat A.L defines as a long type (32 bit, long integer)
6. Mat A.f / Mat A.F defines as a double-precision real number type (64 bit, double real) 

* Elements of each matrix is defined as the above type.


Function
  1. Definition of matrix type is available at matric allocation.
  2. Definition of matrix type is also available at initialization. User can change the matrix type which is once allocated or initialized in deferent type of matrix (see Example 1).
  3. Excepting a bit type, all other type of matrix Mat A[m,n] is Mat A[<row>,<column>]
  4. A bit type matrix is designed to handle bitmap, then the matrix is Mat A[X,Y] = Mat A[<coloum>,<row>] (see Example 2).
  5. Mat A.v / Mat A.V is a special matrix that directly reflect VRAM bitmap (see Example 2).

Note

Example 1

    [[1,2,3,4][5,6,7,8]]→Mat A.b
    Locate 1,1,ElmSize(A)
    Mat A→Dim Mat A.w
    Locate 1,2,ElmSize(A) 

This code display as follows;

    8
    16

The third line it to change matrix type.

ElmSize( )
returns bit size of elements. Defined by Mat A.b, a bit size of the elements is 8 bit. Transferring the matrix type from byte type to word type, the bit size of the elements is 16 bit. 


Example 2

    ClrGraph
    For -1→Y To 1 Step 0.1
        PlotOn 0,Y
    Next
    {127,63}→Dim Mat A.v
    0→P
    For 1→Y To 63
        For 1→X To 127
            P+A[X,Y]→P
        Next
    Next
    Locate 1,1,P


This code display as follows;

    21

{127,63}→Dim Mat A.v sets bitmap data of VRAM in Mat A. When a graphics command is processed automatically the VRAM bitmap reflected to the Mat A.

This code draws 21 dots at first then define Mat A.v. At this time the Mat A is directly reflected to bitmap data of VRAM. An element of the Mat A is 0 or 1, 

After allocating the Mat A, interestingly this matrix has already bitmap data of VRAM. Then calculating summary of all the elements should be a number of drawn dots. The dysplayed result shows the number of total drawn dots is 21.


Example 3

Exampl 2 is a sample to read out VRAM bitmap data. This Example 3 is to reflect VRAM bitmap data to LCD screen.

    ClrGraph
    Screen.G
    {127,63}→Dim Mat A.v
    For 53→X To 73
        1→A[X,31]
    Next
    PutDispDD

Before running a graphics drawing command, automatically text screen is selected, then swap to graphics screen by Screen.G. Mat A is allocated after ClirGraph then every element of the matrix is 0. Following code sets 21 pixels to 1. PutDispDD command transfers the VRAM data to LCD screen.
 



See also: ElmSize( ), PutDispDD, Screen

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

Type of Number (C.Basic)

 Type of Number
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Description

i. An Available types of number are doulbe-precision real number (64bit) and integer (32bit) which depends on Casio SDK.
    - A range of the available double-recision real number is
        ±9.88131291682493x10-323 to ±1.7976931348623151x10
308
    - A range of the available integert is
        -2,147,483,648 to 2,147,438,647

ii. C.Basic may result in deferent calculation error.
    - Casio Basic uses BCD (Binary Coded Decimal) with internal 15 digit and 10 digit + 2 digit exponent for display. 


iii. The type of number is controlled by an executing mode, a feature of C.Basic.
      - C.Basic has two (2) deferent executing modes; a doulbe-precision real number mode and an integer mode.
      - User can select the executing mode


Syntax

1. <number> with no prefix (decimal)
2. 0x<number> or 0X<number> (hexadecimal>
3. 0b<number> or 0B<number> (binary)


Function
  1. A default <number> with no prefix is decimal number.
  2. With prefix 0x or 0X, the number is hexadecimal.
  3. With prefix 0b or 0B, the number is binary. 
  4. Initializes a matrix by filling all elements with <number>, it's same as Fill comamnd.

Note

Example 1

    0xFF→A
    Locate 1,1,A
    0b1010011→B
    Locate 1,2,B 

This code display as follows;

    255
    83

where 0xFF=255 and 0b1010011=83.


Example 2

    '#CBdbl
    1.23→N
    Locate 1,1,N
    '#CBint
    Locate 1,2,N


This code display as follows;

    0.23
    0

'#CBdbl sets Executing Mode in double-precision real (64bit) mode, then all the processes are carried out with 64bit numbers. C.Basic provides two (2) types of variable set; a double-precision real (64bit) and an integer (32bit) variable set. In the 'doulbe (64bit)' mode the variable N is 'double (64bit)' variable. That's why Locate 1,1,N dislays 0.23

'#CBint sets in integer (32bit) mode and C.Basic proceses with 32bit numbers. In the 'integer (32bit)' mode the variable N is 'integer (32bit)' variable. That's why Locate 1,2,N displays 0.

Opening Variable Review screen by key press [SHIFT][F1](Var) to press [F3](D<>I) to swap lost of 'double (64bit)' variables and 'integer (32bit)" variables. it shows 'double N' is 0.23 and 'integer N' is 0




See also: Executing Mode, Variable Review Screen

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

Initialize & Substitute to Matrix (C.Basic)

 Initialize & Substitute to Array
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Syntax

Compatible
1. Fill(<number>)

Compatible + Extended (see Note below)
2. [[<E11>,<E12>, ...][<E21>,<E22>, ...] ... ]→Mat A  (Allocates & Initializes Matrix)

Extended
3. [["<string 1>"]["<sring 2>"] ... ]→Mat A    (Allocates & Initializes Matrix)
4. <nunber>→Mat A



Key Press

Mat        [SHIFT][2] 


Function
  1. Initializes a matrix by filling all elements with Fill(<number>).
  2. Initializes a matrix by setting every elements <Eij>.
  3. Initializes a matrix by setting strings <string n>
  4. Initializes a matrix by filling all elements with <number>, it's same as Fill comamnd.

Description
  1. User must allocate memory for a matrix before initialize and use it.
  2. It's recommended that user release the allocated memory for matrix before end of program. Otherwise the allocated memory reamains until the same matrix is allocated or initiaized again.
  3. <Eij> means an element at row i and column j (see Example 1).
  4. User can use strings <string n> to allocate and initialize a matrix (see Example 2 & 3).

Note

Example 1

C.Basic allows user to use carriage return and space within [ ]. Allocating and initializing a matrix in the following way is good for easy-to-read sorece code;

    [
      [0x1234,0x2345,0x3456]
      [0x4567,0x5678,0x6789]
      [0x789A,0x89AB,0x9ABC]
    ]Mat A


User can explicitly write a constant in hexadecimal or binary expression by adding prefix "0x"/"0X" or "0b"/"0B" subsequently. 


Example 2

Extended usage of matrix helps strings operation, see following sample;

    [
      "1:ABC",
      "2:DEF",
      "3:GHI"
    ]→>Mat S
    Locate 1,2,&Mat S[1]
    Locate 1,3,&Mat S[2]
    Locate 1,4,&S[3]
    Locate 1,5,&S[1,3]
    Clrmat

This code dislays as follows;

    1:ABC
    2:DEF
    3:GHI
    ABC


This way is similar to string handing of C language. Instead of & user can use $.
User can write S[ ] instead of Mat S[ ]


Example 3

    [
      "ABCD",
      "EFGH"
    ]→Mat B
    Locate 1,1,B[1,1]:Locate 4,1,B[1,2]
    Locate 7,1,B[1,3]:Locate 10,1,B[1,4]:Locate 13,1,B[1,5]
    Locate 1,2,B[2,1]:Locate 4,2,B[2,2]
    Locate 7,2,B[2,3]:Locate 10,2,B[2,4]:Locate 13,2,B[2,5]
    
This code displays as follows;

    65 66 67 68 0
    69 70 71 72 0

Each element is a charactor code of each alphabet. When allocate the matrix in this way using strings, the matrix is 2 rows x 5 columns, not 2 rows x 4 column. each row corresponds to each string and 0 (zero) is automatically added in the last column. 




See also: Initialize Matrix, <number>->Mat A, <string>->Mat A, '#Str

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.



関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

Allocates Matrix (C.Basic)

 Allocate Matrix
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Syntax

Compatible with Casio Basic
1. {<row>,<column>}→Dim A     (Allocates matrix)

Compatible + Extended (see Note below)
2. [[<E11>,<E12>, ...][<E21>,<E22>, ...] ... ]→Mat A  (Allocates & Initializes Matrix)

Extended (see Note below)
3. [["<string 1>"]["<sring 2>"] ... ]→Mat A    (Allocates & Initializes Matrix)

Compatible with Casio Basic
4. ClrMat Mat A    (Releases matrix)


Key Press

Dim       [F3](CMD) --> [down]/[up] --> [9](9:Dim)
Mat        [SHIFT][2] 

ClrMat   [F3](CMD) --> [down]/[up] --> [9](9:ClrMat)


Function
  1. Allocates memory for Matrix by setting of row and column number (m, n).
  2. Allocates and initializes Matrix by setting every elements (<Eij>).
  3. Allocates and initializes Matrinx by setting strings ("<string n>")
  4. Releases Matrix memory region.

Description
  1. User must allocate memory for a matrix before initialize and use it.
  2. It's recommended that user release the allocated memory for matrix before end of program. Otherwise the allocated memory reamains until the same matrix is allocated or initiaized again.
  3. <Eij> means an element at row i and column j (see Example 1).
  4. User can use strings <string n> to allocate and initialize a matrix (see Example 2 & 3).

Note

Example 1

C.Basic allows user to use carriage return and space within [ ]. Allocating and initializing a matrix in the following way is good for easy-to-read sorece code;

    [
      [0x1234,0x2345,0x3456]
      [0x4567,0x5678,0x6789]
      [0x789A,0x89AB,0x9ABC]
    ]→Mat A


User can explicitly write a constant in hexadecimal or binary expression by adding prefix "0x"/"0X" or "0b"/"0B" subsequently. 


Example 2

Extended usage of matrix helps strings operation, see following sample;

    [
      "1:ABC",
      "2:DEF",
      "3:GHI"
    ]→Mat S
    Locate 1,2,&Mat S[1]
    Locate 1,3,&Mat S[2]
    Locate 1,4,&S[3]
    Locate 1,5,&S[1,3]
    Clrmat

This code dislays as follows;

    1:ABC
    2:DEF
    3:GHI
    ABC


This way is similar to string handing of C language. Instead of & user can use $.
User can write S[ ] instead of Mat S[ ]


Example 3

    [
      "ABCD",
      "EFGH"
    ]→Mat B
    Locate 1,1,B[1,1]:Locate 4,1,B[1,2]
    Locate 7,1,B[1,3]:Locate 10,1,B[1,4]:Locate 13,1,B[1,5]
    Locate 1,2,B[2,1]:Locate 4,2,B[2,2]
    Locate 7,2,B[2,3]:Locate 10,2,B[2,4]:Locate 13,2,B[2,5]

    
This code displays as follows;

    65 66 67 68 0
    69 70 71 72 0

Each element is a charactor code of each alphabet. When allocate the matrix in this way using strings, the matrix is 2 rows x 5 columns, not 2 rows x 4 column. each row corresponds to each string and 0 (zero) is automatically added in the last column. 




See also: Initialize Matrix, <number>->Mat A, <string>->Mat A, '#Str

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

Array

 Array
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Syntax

<natural number>→Dim A     (Allocate array)
A[<index>]                            (an Array)
0→Dim A                               (Release array) 


Key Press

Dim   [F3](CMD) --> [down]/[up] --> [9](9:Dim)


Function
  1. When allocated n elements for the array, user can use A[1], A[2], ... A[n].

Description
  1. A - Z (capital letters) can be used for the array variables.
  2. An array provided by fx-5800P Casio Basic is more convenient than matrix, that's why C.Basic provides array.
  3. The array must be initialzed (allocated in memory), and cleared (reased from memory) in a program.
  4. <index> should be natural number, 0 (zero) cannot be used.
  5. 100->Dim Z is same as [100,1]->Mat Z, Z[100] is same as Mat Z[100,1] and 0->Dim Z is same as ClrMat Z.

Note

Sample program, display of Fibonacci sequence;

    50→Dim A
    1→A[1]:1→A[2]
    For 3→I To 50
        A[I-2]+A{I-1]→A[I]
        Locate 1,1,"I="
        Locate 3,1,I
        Locate 1,2,"A[I]="
        Locate 6,2,A[I]
        Getkey1
    Next
    0→Dim A





See also: Getkey1

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

'/ Comment-out only for Original Casio Basic

 '/ Comment-out only for Original Casio Basic
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Syntax

'/<command or expression>
 

Key Press

'/  [F3](CMD)[F5](')[F6](/)


Function
  1. <command or expression> runs on C.Basic but ignored on original Casio Basic.

Description
  1. Basic concept of C.Basic is to be compatible with original Casio Basic. In order to share a same program file with both of C.Basic and original Casio Basic, '/ helps.

Note

Sample programs how to use '/;

Main program: MAIN
    200→L
    '/Prog "WAIT"
    ....
    ....
    ....


Sub-routine program; WAIT
    Locate 1,4,"= Now Checking Wait ="
    0→%:0→L
    Do
    Isz L
    LpWhile %<64
    ClrText

    

A program runs much faster on C.Basic than original Casio Basic. So some programs which depends on slow response of original Casio Basic may have problem on the fast C.Basic. For example, when variable L is used to set some wait and 200 is proper for the 'slow' Casio Basic, the wait value 200 should be too small on C.Basic.

Then the Sub-routine "WAIT"obtains a proper wait value corresponding to 0.5 second, the variable L is global then shared with "MAIN" program. The "MAIN" program should call sub-program "WAIT" only on C.Basic by

'/Prog "WAIT"

User can share the "MAIN" program with both Casio Basic and C.Basic.



See also: Prog, Getkey1, Switch Statement

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

GoSub Command

 Gosub... Lbl... Return
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Syntax

Gosub <Lable x>
....
....
Lbl <Lable x>
....
....
Return
 

Key Press

GoSub:  [F3](CMD) -> [down]/[up] -> [E](E:Gosub)
Lbl:        [F3](CMD) -> [down]/[up] -> [4](4:Then)
Return:  [F3](CMD) -> [down]/[up] -> [5](5:Else)


Function
  1. Go to Lbl <label x> and then at the first Return below the Lbl, go back to next to Gosub <lable n>. 

Description
  1. Gosub can jump to Lbl <label n> wihtin a program file.

Note

Sample code to see how Gosub and Return works;
 
Sample code: MAIN
    Prog "GOSUB"
    Locate 1,3,"Three"


Then call GOSUB;

Sample code: GOSUB
    Gosub A
    Locate 1,2,"Two"
    Return
    Lbl A
    Locate 1,1,"One"
    Return



The output is,

    One
    Two
    Three

This output tells you that the first Return comamnd returns back to the main program and the second Return command returns back to next to Gosub A.



See also: Goto, Lbl

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

最新記事
検索フォーム
最新コメント
カテゴリ
C# (3)
Online Counter
現在の閲覧者数:
プロフィール

やす (Krtyski)

Author:やす (Krtyski)
since Oct 30, 2013


プログラム電卓は、プログラムを作って、使ってナンボ!

プログラム電卓を実際に使って気づいたこと、自作プログラム、電卓での Casio Basic, C.Basic そして Casio Python プログラミングについて書いています。

なお管理人はカシオ計算機の関係者ではありません。いつでもどこでもプログラミングができるプログラム電卓が好きな1ユーザーです。


写真: 「4駆で泥んこ遊び@オックスフォード郊外」

リンク
月別アーカイブ
Sitemap

全ての記事を表示する

ブロとも申請フォーム

この人とブロともになる

QRコード
QR