: Multi-Statement Command & Display Suppression

 : Multi-Statement Command & Refresh Suppression
<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

<satement 1>:<statement 2>: ... :<statement n>
<display command>
:
 

Key Press

: [F3](CMD)[F3](:)


Function
  1. Connects two statements for sequential excution without stopping..
  2. Suppresses display on LCD screen.

Description
  1. <statement n> can be a command or an expression. The multi-statement command is identical with and carriage return. 
  2. All of graphics display commands excepting Text command output to VRAM at first. Data in VRAM is transfered to LCD screen every about (1/40) seconds, then the graphics pattern or clear commands (ClrGraph and Cls) is displayed. On the other hand Text, Locate, and ClrText comamnds directly reflect to LCD screen. The : command which comes right after all the display command suppressed data transfer from VRAM to LCD screen. Held in VRAM once by the : command,
  3. PutDispDD and Text command prompt to transfered the data to LCD screen.
  4. When display of text or graphics is very frequent, user may see blinking of display, user may be able to mitigate the blinking by using : command.

Note

Example of plottin dots;

    ClrGraph
    For -3→J To 3 Step 0.1
    For -3→I To 3 Step 0.1
        PlotOn I,J
    Next:Next
    PutDispDD


This program draws black square and you will see dots are plotted from bottom to top. Each time PlotOn I,J processed the plot data is transfered to VRAM and also transfered to LCD (refresh) screen every (1/40) seconds.

When : is added after PlotOn I,J to suppress the refreshing LFD;

    ClrGraph
    For -3→J To 3 Step 0.1
    For -2→I To 3 Step 0.1
        PlotOn I,J:
    Next:Next
    PutDispDD


Then you will see popping-up black square at once. Becasue the output of PlotOn I,J is transfered to VRAM but suppressed to transfer to LCD screen each time, then PutDispDD transfers VRAM data to LCD screen.

User can use for example Text 1,1,"" (output no characters) instead of PutDispDD command





See also: Locate, Text, ClrText, PutDispDD

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


関連記事

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

Prog Command (C.Basic)

 Prog
<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 original Casio Basic
    Prog
 "<file name>"    (compatible with original Casio Basic)

Extended
    Prog
 "<file name>",<Variable 1>, ... , <Variable k>, ... ,<Variable n>
    Prog "<file name>"<variable>
    Prog "<file name>",<variable 1>, ... ,<variable n><variable>
 

Key Press

Prog:  [F3](CMD) -> [down]/[up] -> [5](5:Prog)


Function
  1. Calls program file <file name>.
  2. Passes values to the called program using Local command.

Description
  1. Calls sub-routine file <file name>.
  2. Calls sub-routine program by Prog "<file name>",<Variable 1>,<Variable 2>, ... ,<Variable k> in main program and Local <small letter Variable 1>, ... <small letter Variable k>, ... <small letter Variable n> in the called program, then this combination of Prog and Local commands can set those k pcs variables to same values as <Variable 1> to Variable k> subsequentoy. Such combination of extended Prog and Local commands allow user to pass values to deferent program file.
  3. User can obtain a return value from the called sub-routine program. Prog command obtains Ans variable and return this.

Note

Example 1: passes value with Prog command;

Main program: MAIN
    "Press any key"
    Prog "SUB",Getkey1


Sub-routine program; SUB
    Local k
    Switch k
        Case 72
            "One"
            Break
        Case 62
            "Two"
            Break
        Case 52
            "Three"
            Break
        Default
            "Else"
    SwitchEnd


where value of Getkey1 is passed to the program SUB and the variable k is local.


Example 2: obtains return from sub-routine

Main program: MAIN
    "Press key"
    Prog "SUB",Getkey1→N
    Locate 1,3,N


Sub-routine program: SUB
    Local k
    Switch k
        Case 72
            "One"
            Break
        Case 62
            "Two"
            Break
        Case 52
            "Three"
            Break
        Default
            "Else"
    SwitchEnd
    k:Return


 
As same as original Casio Basic, value of a last variable or a last expression in program is saved in Ans variable. The variable k is stored in Ans variable then Prog returns the value in Ans variable.

Instead of the MAIN program above, following code is also available;

Main program: MAIN
    "Press key"
    Prog "SUB",Getkey1
    Ans→N
    Locate 1,3,N

    

Example 3: obtains return from sub-routine using parameter of Return

Main program: MAIN
    "Press key"
    Prog "SUB",Getkey1→N
    Locate 1,3,N

Sub-routine program: SUB 
    Local k
    Switch k
        Case 72
            "ONE"
            Break
        Case 62
            "TWO"
            Break
        Case 52
            "THREE"
            Break
        Default
            "ELSE"
    SwitchEnd
    Return k 




See also: Prog, Getkey1, Switch Statement

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


関連記事

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

Local Command

 Local
<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

Local <small letter Variable 1>,<small letter Variable 2>, ... , <small letter Variable n>
 

Key Press

Local:  [F3](CMD) -> [down]/[up] -> [.](.:Local)


Function
  1. <small letter Variable n> can be local variable in the program file where Local command is used.
  2. Local command sets 'passed values' combined with exteded Prog comamnd. 

Description
  1. All variables are Global, which are all the variables are shared in all program files. This is comatible with original Casio Basic. If user wants to use some Local variables which are not shared with other program files, use Local command to set only small letter variables whatever the user wants to use.
  2. Calls sub-routine program by Prog "<file name>",<Variable 1>,<Variable 2>, ... ,<Variable k> in main program, and Local <small letter Variable 1>, ... <small letter Variable k>, ... <small letter Variable n> in the called program, then this combination of Prog and Local commands can set those k pcs variables to same values as <Variable 1> to Variable k> subsequentoy. Such combination of extended Prog and Local commands allow user to pass values to deferent program file.

Note

Example of value passing;

Main program: MAIN
    "Press any key"
    Prog "SUB",Getkey1



Sub-routine program; SUB
    Local k
    Switch k
        Case 72
            "One"
            Break
        Case 62
            "Two"
            Break
        Case 52
            "Three"
            Break
        Default
            "Else"
    SwitchEnd


where value of Getkey1 is passed to the program SUB and the variable k is local.



See also: Prog, Getkey1, Switch Statement

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


関連記事

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

If Statement (C.Basic)

 If... Then... [Else]... IfEnd
<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

If <Value 1>
    Then
    <statement 1>
[Else]
   
<statement 2>
IfEnd

* Adding space for indent is available with C.Basic (Original Casio Basic does not allow this).
 

Key Press

If:        [F3](CMD) -> [down]/[up] -> [3](3:If)
Then:  [F3](CMD) -> [down]/[up] -> [4](4:Then)
Else:    [F3](CMD) -> [down]/[up] -> [5](5:Else)
IfEnd:  [F3](CMD) -> [down]/[up] -> [6](6:IfEnd)


Function
  1. Evaluates <value 1> then if the result is is TRUE (= not zero) then run <statement 1>, otherwise (the result is FALSE (= zero)) then go to Else. The Else can be omitted,  

Description
  1. <value n> can be a variable, an expression or a command which returns value.
  2. IfEnd is internally just a label, so in some case If statement without IfEnd may work and not alarm "Syntax ERROR" in default setting of C.Basic. This is compatible feature with original Casio Basic.
  3. C.Basic can strictly check the missing IfEnd as a "Syntax ERROR". If user wants this strict check, go to Setup Screen by pressing [SHIFT][MENU](SEET UP), find an item "IfEnd Check", then set "On" by pressing [F1](On).

Note

Example of missing IfEnd;

Sample code with missing IfEnd
    If A=1:Then
        "ONE"
    Else If A=2:Then
        "TWO"
    Else If A=3:Then
        "THREE"
    Else
        "ELSE"
    IfEnd:IfEnd


There should be 3 IfEnds.

Correct Syntax
    If A=0:Then
        "ONE"
    Else If A=2:Then
        "TWO"
    Else If A=3:Then
        "THREE"
    Else
        "ELSE"
    IfEnd:IfEnd:IfEnd





See also: Switch Statement

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

関連記事

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

Double and Integer Variables

 Double and Integer Variables
<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

<variable>
#      (ex) A#, a#
<variable>%     (ex) A%, a%


Key Press

#    
 [F3](CMD) -> [down]/[up] -> [.](.:#)
%    [F3](CMD) -> [down]/[up] -> [EXP](E:%)


Function
  1. # sets <variable> to be double type (64bit).
  2. % sets <variable> to be integer type (8bit).

Description
  1. User can use A#, a#, A% and a%, totally 104 (26 x 4) variables.
  2. Default varible type is double.

Note
  1. Script '#CBASIC, '#CBasic, '#CBDBL or '#CBdbl changes default variable type to double.
  2. Script '#CBINT or '#CBint changes default variable type to integer.
  3. Default variable type can be set by Execute mode setting in Setup Screen of C.Basic. Press [SHIFT][MENU] to get into Setupt Screen, and set Dbl# or Int% at the last item Execute mode
  4. In Edit Screen, press [SHIFT][F1](Var) to get into Variable Review Screen. Press [F1](A<>a) or [F3](D<>I) to review all the variables. Press [F2](Init) to initialize currently displayed type of variables. 


See also: '#CBasic, '#CBdbl, '#CBint ,Variable Review Screen, Setup Screen

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

関連記事

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

Small Letter Valriables

 Small Letter Variables
<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

a
(a - z)


Key Press

[F4](A<>a) to switch Capital Letter and Small Lettter


Description
  1. User can use more variables than original Casio Basic.


See also: %, #, Variable Review Screen

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

関連記事

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

Switch Statement

 Switch... Case... Default... SwitchEnd
<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

Switch
<value>
    Case
<number1>
        <statement>
        Break
    Case <number2>
        <statement>
    Case
<number3>
        <statement>
    ....
    ....
    Case <number n>
        <statement>
        Break
    Default
        <statement>
        [Break]
SwitchEnd

* Adding space for indent is available with C.Basic (Original Caso Basic does not allow this).


Key Press

Switch
:       [F3](CMD) -> [down]/[up] -> [6](6:Switch)
Case:          [F3](CMD) -> [down]/[up] -> [7](7:Case)
Break:        [F3](CMD) -> [down]/[up] -> [1](1:Break) 
Default:      [F3](CMD) -> [down]/[up] -> [8](8:Default)
SwitchEnd:  [F3](CMD) -> [down]/[up] -> [9](9:SwithEn)


Function
  1. Evaluates <value> and jump to selected <number n>.

Description
  1. This statement is same as switch / case (C language) or Select Case / Case (Visual Basic).

Note
  1. Default must come to the last.
  2. Like C language, fall through without Break is available.

Sample Code


Lbl 0
ClrText
"Press key"
Switch Getkey1
    Case 72
      "ONE"
      Break
    Case 62
      "TWO"
    Case 52
      "THREE"
      Break
    Default
      "ELSE"
SwitchEnd
Goto 0



See also: If Statement, ElseIf Statement, Getkey1, ClrText

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

関連記事

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

ElseIf Statement

 If... Then... ElseIf... [Else]... IfEnd
<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

If <Value 1>
    Then
    <statement 1>
ElseIf
<value 2>
    Then

    <statement 2>
ElseIf
<value 3>
    Then
   
<statement 3>
....
....
ElseIf <value n>
    Then
    <statement n>

[Else]
   
<statement n+1>
IfEnd

* Adding space for indent is available with C.Basic (Original Casio Basic does not allow this).
 

Key Press

If:        [F3](CMD) -> [down]/[up] -> [3](3:If)
Then:  [F3](CMD) -> [down]/[up] -> [4](4:Then)
ElseIf
: [F3](CMD) -> [down]/[up] -> [9](9:ElseIf)
Else:    [F3](CMD) -> [down]/[up] -> [5](5:Else)
IfEnd:  [F3](CMD) -> [down]/[up] -> [6](6:IfEnd)


Function
  1. Evaluates <value n> then if the result is is TRUE (= not zero) then run <statement n>, otherwise (the result is FALSE (= zero)) then go to the next  ElseIf or Else. The Else can be omitted,
  2. IfEnd is internally just a label, so in some case code without IfEnd may work and may not alarm "Syntax ERROR" in default setting of C.basic. This is compatible feature of original Casio Basic.
  3.   C.Basic can strictly check the missing IfEnd as a "Syntaz ERROR". If user wants this strict check, go to Seup Screen by pressing [SHIFT][MENU](SET UP), find an item "IFEnd Check" then set "On" by pressing [F1](On).

Description
  1. <value n> can be a variable, an expression or a command which returns value.

Note

Compared with the following 2 sample codes, ElseIf does not require multiple IfEnd;

Original Casio Basic
    If A=1:Then
        "ONE"
    Else If A=2:Then
        "TWO"
    Else If A=3:Then
        "THREE"
    Else
        "ELSE"
    IfEnd:IfEnd:IfEnd


C.Basic
    If A=0:Then
        "ONE"
    ElseIf A=2:Then
        "TWO"
    ElseIf A=3:Then
        "THREE"
    Else
        "ELSE"
    IfEnd



See also: Switch Statement

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

関連記事

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

Locate Command (C.Basic)

 Locate
<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

Locate
 <column>,<row>,<value>     [Compatible with Casio Basic)
Locate <column>,<row>,<value>,R  [Extended by C.Basic]


Key Press

[F3](CMD) -> [down]/[up] -> [4](4:Locate)


Function
  1. Locate displays <value> in text screen.
  2. With R parameter, the displayed <value> is inversed.

Description


Note
  •   

See also: Text, LocaeYX, Seup Screen

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

関連記事

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

LocateYX Command

 LocateYX
<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

LocateYX <row>,<column>,<value>
LocateYX <row>,<column>,<value>,R


Key Press

[F3](CMD) -> [down]/[up] -> [6](6:LocateYX)


Function
  1. LocateYX displays <value> in graphics screen with same font of Locate in text screen.
  2. With R parameter, the displayed <value> is inversed.

Description
  1. LocateYX is an graphcs command and <row>,<colum> setting is in same way of Text command.

Note


 


See also: Text, Locae

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

関連記事

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

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

やす (Krtyski)

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


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

実際に触って気づいたこと、自作プログラム、電卓プログラミングについて書いています。

なお管理人はカシオ計算機の関係者ではなく、Casio Basicが面白いと感じる1ユーザーです。


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

リンク
月別アーカイブ
Sitemap

全ての記事を表示する

ブロとも申請フォーム

この人とブロともになる

QRコード
QR