Jump to content



Photo
* * * * * 4 votes

C.Basic - International Release

Casio Basic C.Basic

  • Please log in to reply
654 replies to this topic

#641 Hlib2

Hlib2

    Casio Addict

  • Members
  • PipPipPip
  • 68 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860gii-2, afx-2.0+
    fx-9750gii, fx-9750g+
    cfx-9850gb+, graph25
    fx-991DE_X, fx-991ES+
    ti-voyage200(emulator)
    ti-83+_SE, ti-85, hp-50g

Posted 06 July 2020 - 09:29 AM

@Sentaro21
A few comments about minor bugs.
1) mode Sci4/E, editing alpha variables Shift F1 (var),
input: 8E-4 EXE
result: 800.0000.....01μ (should be 800μ).
tried to edit: ►, EXE
result: Syntax ERROR
input: 0.06526
result: 65.25999.....9m (should be 65.26m)
tried to edit: ►, EXE
result: 0.000E0
These features sometimes do not allow to use in program an engineering format for displaying results.
2)
Lbl 1
"N="?➝N
Disp RndFix(N,3)
Goto 1
mode Nrm10
2a) If you apply a record like ?➝N, the character ? is not translated on a new line.
2b) input: 7.6575 -> result: 7.657
input: 3.6575 -> result: 3.658
The instability of the rounding rules sometimes leads to the fact that when analyzing the data, they fall into the wrong interval.

#642 siealex

siealex

    Casio Fan

  • Members
  • PipPip
  • 41 posts
  • Gender:Male

  • Calculators:
    570w, 570ms, 83es, 570es, 83gt plus, 991es plus, 991de plus, 570spx ii, 9750gii

Posted 09 July 2020 - 04:29 PM

The instability of the rounding rules sometimes leads to the fact that when analyzing the data, they fall into the wrong interval.

Does it use binary representation for internal calculations?



#643 Hlib2

Hlib2

    Casio Addict

  • Members
  • PipPipPip
  • 68 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860gii-2, afx-2.0+
    fx-9750gii, fx-9750g+
    cfx-9850gb+, graph25
    fx-991DE_X, fx-991ES+
    ti-voyage200(emulator)
    ti-83+_SE, ti-85, hp-50g

Posted 09 July 2020 - 05:27 PM

Does it use binary representation for internal calculations?

It looks like it is. Here are examples of rounding (RndFix(N,2)) results in C.BASIC:
1.155➜1.16__1.325➜1.33__1.875➜1.88
2.155➜2.15__2.325➜1.32__2.875➜2.87
3.155➜3.16__3.325➜3.33__3.875➜3.87
4.155➜4.15__4.325➜4.32__4.875➜4.88

#644 Hlib2

Hlib2

    Casio Addict

  • Members
  • PipPipPip
  • 68 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860gii-2, afx-2.0+
    fx-9750gii, fx-9750g+
    cfx-9850gb+, graph25
    fx-991DE_X, fx-991ES+
    ti-voyage200(emulator)
    ti-83+_SE, ti-85, hp-50g

Posted 10 July 2020 - 07:25 PM

@Sentaro21
1) Debugging one of my programs, I encountered such a problem.
Rad:"5sin X"➝Y1
`#CBINT
0➝B:Y1(B)➝A
`#CBDBL
Disp "A%=",A%
result: A%=5 (incorrect)
The code "sin X" ➝Y1 produces an Syntax ERROR, because the trigonometric functions do not work in `#CBINT mode in entries like this. Adding of 5 removes the error, but runs as "5"➝Y1. With variables like fn, everything works correctly and without errors.
2) List 1+iList 2 - this has stopped working again (`#CBCPLX setting)

Edited by Hlib2, 10 July 2020 - 10:49 PM.


#645 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 361 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 11 July 2020 - 10:47 AM

@Hlib2
Sorry for late replay. :bow:
Thanks for bug report!
The reported bugs have been confirmed.
I'll fix it all together in the next update. ^_^
 

2) List 1+iList 2 - this has stopped working again (`#CBCPLX setting)

What kind of data is contained in List 1 and List 2?
 
 
@siealex

Does it use binary representation for internal calculations?

Yes.
It uses the SDK's floating point library. :)
 

 



#646 Hlib2

Hlib2

    Casio Addict

  • Members
  • PipPipPip
  • 68 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860gii-2, afx-2.0+
    fx-9750gii, fx-9750g+
    cfx-9850gb+, graph25
    fx-991DE_X, fx-991ES+
    ti-voyage200(emulator)
    ti-83+_SE, ti-85, hp-50g

Posted 11 July 2020 - 12:17 PM

@Sentaro21
Thank You for your concernment!

What kind of data is contained in List 1 and List 2?

 
`#CBDBL
Seq(√x,x,1,5,1)➝List 1.F
Seq(e^x,x,1,5,1)➝List 2.F
`#CBCPLX
5➝Dim List 3.C // **
List 1+iList 2➝List 3
After point // ** program changes the List type from C to F. Also, please check, if possible, fn with trigonometric functions in `#CBINT mode. In my "Bench C.BASIC" prog they sometimes have incorrect results in speed and in calculations. I would like to publish this program as soon as possible. But if I`ll add "Try~Except~TryEnd" blocks to it, it will take a long time again to finish.

Edited by Hlib2, 11 July 2020 - 12:21 PM.


#647 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 361 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 12 July 2020 - 12:20 PM

@Hlib2
Thanks!!
Both confirmed the bug. :)
 
As for the try command, please don't use it if you have a problem because it is not fully implemented. :bow:


#648 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 241 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:Playing video games (Minecraft, krunker.io), calculators, programming in Casio Basic/C.Basic, Scratch (formal), IT research (sometimes)

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-9750GIII (2020/6/13)

Posted 07 August 2020 - 08:06 AM

@Sentaro21 @Krtyski
Just a reminder of my messages in e-Gadget C.Basic CG development thread. (^^;

#649 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 241 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:Playing video games (Minecraft, krunker.io), calculators, programming in Casio Basic/C.Basic, Scratch (formal), IT research (sometimes)

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-9750GIII (2020/6/13)

Posted 10 August 2020 - 08:07 AM

Hi Sentaro21 and Krtyski

Suggestion 1

It seems like the Beep command is forked from the Send38k/Send command with specific values. And the latter command has interrupt option which can forcibly stop sending by pressing EXIT key. Can you also add an interrupt option to Beep command?

Syntax: Beep [<Frequency (Hz)>,<Duration (ms)>,<interruption (Getkey value/0)>]

New addition:<interruption (Getkey value/0)>
Stop outputting sound forcibly by pressing certain key.
If the value is 0, all keys can interrupt sound outputting.

Example 1: Beep 440,1000,31
Output 440Hz sound for 1 second, can be interrupted by EXE key.

Example 2: Beep 100,500,0
Output 100Hz sound for 0.5 second, can be interrupted by any key.

Suggestion 2

The ? command in C.Basic FX does not support Text coordinate even if @ is added in front of the xy.

Cheers
CalcLoverHK

Edited by CalcLoverHK, 14 August 2020 - 08:01 PM.


#650 Hlib2

Hlib2

    Casio Addict

  • Members
  • PipPipPip
  • 68 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860gii-2, afx-2.0+
    fx-9750gii, fx-9750g+
    cfx-9850gb+, graph25
    fx-991DE_X, fx-991ES+
    ti-voyage200(emulator)
    ti-83+_SE, ti-85, hp-50g

Posted 30 October 2020 - 01:43 PM

It is very strange that when playing the BEEP sound effect, the SH4 processor in CASIO calculators interrupts the execution of the main calculation program. This looks perfectly normal for a $5 Tetris-type pocket toy. But for the SH4 processor in such a complex device as a graphical calculator, there is no justification for this in dynamic programs. I made a board of six medium-integration CMOS chips (late-1970s technology from TI), which partially solves this problem at the hardware level. The BEEP(M, N) signal at the output is interpreted as a sound effect code if M=1000 and N≤8. If M=1000 and N=1...8, the sound effect is played according to the code N with a delay for the time of the BEEP(1000,N) command t<0.01_sec without the interruption of a program for BEEP effect. If N>8 or M≠1000 - the signal from the program is played back with a delay for the duration of the BEEP command. The circuit consumption in sleep mode is not more than 5_µa. Making a block that fits in the calculator case exceeds the cost of $200. In my first attempt, an error occurred with the size of the capacitor. This resulted in the board being deformed, the conductive layer being destroyed, and the calculator being thrown into the trash:
32130391_m.jpg
The next attempt was successful, but now it exceeds the cost of the calculator by 5...10 times, as new options have been introduced: sound volume and the "key press sound" function.
If I were a programmer, this solution would be more efficient :-)

Edited by Hlib2, 30 October 2020 - 04:22 PM.


#651 HappyCalc

HappyCalc

    Newbie

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2

Posted 31 October 2020 - 12:32 PM

Hello! I'm new in this forum, but I have already read this topic as a guest.
@sentaro21
I really like this Addin, because you can program things oncalc.
So, I have some ideas:

1)
I have made a Program to set the Background Light level on an fx-9860GII-2 calculator (using PWM):
'Name: PWMLocal a,bTicks+a->aWhile Ticks0=>BackLight 1Ticks%Wait bbBackLight 0Ticks%Wait 100-bWhileEnd
Variable a are how many Ticks, PWM will run.
Variable b is the Backlight level (0-100)
The Problem of this solution is that if you use heavy calculations between calling "PWM", the Backlight starts to flicker.
My question is, could you enhance "BackLight" to allow inputting a BackLigt level?

2)
Could you enhance Gosub/Label, so you can pass also List/Mat/String like this:
GoFunc,_TEST,10,Mat A,Str 5StopFunc _TEST,a,Mat x,Str 1Locate 1,1,Str 1Mat x×a->Mat xFuncEnd,Mat x
Thanks! :D

#652 HappyCalc

HappyCalc

    Newbie

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2

Posted 31 October 2020 - 12:50 PM

Oh, does anyone now, how to make line breaks inside BBCode "code"-Tag? In my post, a normal line break doesn't work.

#653 HappyCalc

HappyCalc

    Newbie

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2

Posted 14 November 2020 - 09:34 AM

Hello Sentaro21 and Krtyski
I found a bug:
1. Write some numbers to a List
2. Set display mode to x,y
3. Copy List Shift8
-> Only One item was copied
Another Bug:
1. Create a Program that returns a value
2.
If Prog "xyz"
Then "Yes"
Else "No"
IfEnd
Results in Syntax Eroor at line 1

Edited by HappyCalc, 14 November 2020 - 09:35 AM.


#654 Hlib2

Hlib2

    Casio Addict

  • Members
  • PipPipPip
  • 68 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860gii-2, afx-2.0+
    fx-9750gii, fx-9750g+
    cfx-9850gb+, graph25
    fx-991DE_X, fx-991ES+
    ti-voyage200(emulator)
    ti-83+_SE, ti-85, hp-50g

Posted 14 November 2020 - 04:19 PM

@ HappyCalc
Why make it so difficult?
Prog "xyz":If Ans:Then "Yes":Else "No":IfEnd
But if you really want the program to act as a variable,
then this is also possible:
Prog "xyz"➝_xyz:If _xyz:Then "Yes":Else "No":IfEnd

I have made a Program to set the Background Light level on an fx-9860GII-2 calculator

The 9860gii uses an Electro Luminescent backlight with a separate driver. The calculator software does not have access to smooth control the parameters of this driver, except for turning it on and off. I`m afraid that adjusting the backlight in your way may eventually lead the DC/AC converter to malfunction before the intended service life.

Edited by Hlib2, 15 November 2020 - 02:51 PM.


#655 HappyCalc

HappyCalc

    Newbie

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2

Posted Yesterday, 02:18 PM

@Hlib2
Thanks, I just forgot the use of Ans Variable
The Background was the use of a Program similar to IsKeyDown()
I used it in my games to detect multi keypress eg. Left and Up -> diagonal up
--
Does anyone know, how to use StrSplit()?
StrSplit("hello world it's an example", " ")->Str 1
Returns the first element "hello"
Otherwise I would use StrSrc() and StrMid()
Thanks!
:D





Also tagged with one or more of these keywords: Casio Basic C.Basic

1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users


    CalcLoverHK