Jump to content



Photo
* * * * * 4 votes

C.Basic - International Release

Casio Basic C.Basic

  • Please log in to reply
692 replies to this topic

#241 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 20 July 2019 - 08:45 AM

Here are new updated version. :D
Newly supports Graph 35+E II.
 
2.10 beta for 9860G/9860GII series.
        -Added support Graph 35+E II.
         However, hidden memory is halved from 256KB to 128KB. Other specifications are the same.
 
        -Added specification that the initial root folder can be changed.
         You can set the initial root folder to the root or current folder in setup.
        (Note) Previous FX series are always root folder.
 
        -Added support for folder renaming.
        -Fixed the bug that could not be accessed by Save/Load command when the program was executed in main memory.
        -Fixed the bug that cooperation between Plot command and Line command failed.
        -Fixed the drawing bug of Graph(X,Y) with argument of TTheta variable again.
 
1.10 beta for CG10/20/50/Graph90+E.
https://pm.matrix.jp...ICCG110beta.zip    (22.7.2019 updated)
        -Added specification that the initial root folder can be changed.
         You can set the initial root folder to the root or current folder in setup.
        -Fixed the bug that could not be accessed by Save/Load command when the program was executed in main memory.
        -Fixed the bug that cooperation between Plot command and Line command failed.
        -Fixed the drawing bug of Graph(X,Y) with argument of TTheta variable again.
 
 
(22.7.2019 edited) There is a bug remain in Graph(X,Y)
 Please download again.  :bow:

Edited by sentaro21, 22 July 2019 - 12:42 PM.


#242 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 24 July 2019 - 04:18 AM

I updated all my three calculators.

~

I learned that it counts waiting a few days before installing a verson. Some slight changes occure in most time.

Thank you again ! The CG10 version as an official state now, a version >1. Congratulations.



#243 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 24 July 2019 - 07:55 AM

Thanks very much. :D
 
Yes, it is. There is a bug find after every release. :P
I'm sorry I have always caused new bugs. :bow:
 
The CG version has been promoted to beta,
There are still some unresolved processes, such as g3p can not be saved yet.
I think that will be gradually corrected. ^_^


#244 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 29 July 2019 - 10:12 AM

Dear Sentaro,

 

I just program something (electrical / magnetic dipole) and have a question.

 

Would it be possible to support indent in one of the next versions? I find non-indended code nearly unreadable, and always indend by a space. It would be very helpful if I had the amount of spaces conserved after a newline. That means: If I have a few spaces befor the start of the real code in a line, I wish to have the same number of spaces after pressing EXE in the next line. Of yours, there must be a way to delete some of them, to un-indent after a NEXT or so.



#245 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 30 July 2019 - 07:37 AM

Dear Sentaro,

 

I just program something (electrical / magnetic dipole) and have a question.

 

Would it be possible to support indent in one of the next versions? I find non-indended code nearly unreadable, and always indend by a space. It would be very helpful if I had the amount of spaces conserved after a newline. That means: If I have a few spaces befor the start of the real code in a line, I wish to have the same number of spaces after pressing EXE in the next line. Of yours, there must be a way to delete some of them, to un-indent after a NEXT or so.

 

Ok!

I was a little dissatisfied there too.
I would like to add an automatic indent. :)


#246 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 30 July 2019 - 05:01 PM

Hi sentaro21,

 

Does C.Basic support logical operator commands in COMP? (And, Or, Not) Because I couldn't find any of them in fx-9860GII emulator with C.Basic.

 

Regards,

CalcLoverHK



#247 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 30 July 2019 - 11:17 PM

Hi sentaro21,

 

Does C.Basic support logical operator commands in COMP? (And, Or, Not) Because I couldn't find any of them in fx-9860GII emulator with C.Basic.

 

Regards,

CalcLoverHK

Yes :)

OPTN-F6-F6-F4(LOGIC)



#248 Krtyski

Krtyski

    Casio Freak

  • Members
  • PipPipPipPip
  • 132 posts
  • Gender:Male
  • Location:Tokyo, Japan
  • Interests:programming, smooth Jazz and 4-wheel driving.

  • Calculators:
    FX-502P, FX-602P, FX-603P,
    fx-4000P, fx-7000G,
    fx-4500P, fx-4800P
    fx-5800P,
    CFX-9850G,
    CFX-9850GC PLUS
    fx-9860G,
    fx-9860G AU,
    fx-9860G Slim
    fx-9860GII SD,
    fx-9860GII-2,
    fx-9860GII-2 SD,
    fx-CG20, fx-CG50,
    fx-CP400
    fx-9860GIII
    fx-9750GIII
    fx-7400GIII

Posted 31 July 2019 - 09:00 AM

Hi, sentaro21

 

I'm also looking forward to the new indent feature.

 

 

 

Ok!

I was a little dissatisfied there too.
I would like to add an automatic indent. :)

 



#249 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 01 August 2019 - 03:52 PM

Hello, everyone. I'm a high school teacher from Greece teaching computer programming and statistics. First of all C.Basic is the reason I registered in this forum and I'd like to thank sentaro21 for his astounding work with the language. Also to thank Krtyski for his work on translating the website. I hope you people keep up the good work.

I attach a little program I made for the students to manually sample various phenomena. The student starts the program and by pressing buttons 1-9 records the time an event occurs. The program records the button pressed on List 1 and the time interval (counted in Ticks/128) in List 2. The program works just fine so far.

Program terminates by pressing 0 (zero).

So far the students copy the data from the Lists on paper and reenter them in the STAT Lists by hand for further statistical analysis. This is OK for small datasets of 10-20 items. Is there any way at all to copy the C.Basic Lists to CasioBasic Lists so they avoid this tedious work?

My understanding is that since C.Basic works on a different memory space it can't access the CasioBasic Lists. Is there any workaround? For example it would be perfect if I there was a command to copy a C.Basic list to some CasioBasic list. Or even save it to the Main Memory in a compatible format?

Any ideas are acceptable as I'm about to have them start sampling larger datasets for processing.

 

Thanks in advance.

Thanos,

Greece.

 

 

---------- ATTACHED C.BASIC PROGRAM "RTCOUNT"--------

'ProgramMode:RUN
ClrList 1
ClrList 2
0->A
1->L
"ANY KEY TO START"
"PRESS \"0\" TO STOP"
Getkey2

While 1
0->Ticks
Getkey2->A
Ticks/128->C
Locate 2,5,C

A=71=>Break
A=72=>1->B:A=73=>4->B
A=74=>7->B:A=62=>2->B
A=63=>5->B:A=64=>8->B
A=52=>3->B:A=53=>6->B
A=54=>9->B
B->List 1[L]
C->List 2[L]
L+1->L

Locate 2,3,L
Locate 2,4,B
Locate 2,5,C

WhileEnd
List 1
List 2
"Stopped"



#250 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 02 August 2019 - 06:18 AM

Hi,

 

As far as I know, C.Basic uses different interpreter from genuine Casio Basic, thus in fraction or decimal calculations there is an value error. But I don't quite understand because there's actually an unusual way to (may) work. Here are some examples:

 

123.45+67.89

 

You can actually think it as 12345+6789 (=19134), their results looks very similar to each other, except for decimal point. Here, the decimal place value of the answer is 2 (191.34). I think we can just add a decimal point depend on the decimal place value.

 

7.43*12.6

 

Again, it can be like 743*126. This time, the overall decimal place value can be calculated by adding up decimal place value of both (2+1) and getting result of 3, thus 93.168.

 

For 0, I think we can simplify it by adding a detector to check whether the last digit is 0 and it is after decimal point/the decimal place value is not 0.

 

Can this method be possible?

 

Regards,

CalcLoverHK



#251 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 02 August 2019 - 06:46 AM



Hello, everyone. I'm a high school teacher from Greece teaching computer programming and statistics. First of all C.Basic is the reason I registered in this forum and I'd like to thank sentaro21 for his astounding work with the language. Also to thank Krtyski for his work on translating the website. I hope you people keep up the good work.

I attach a little program I made for the students to manually sample various phenomena. The student starts the program and by pressing buttons 1-9 records the time an event occurs. The program records the button pressed on List 1 and the time interval (counted in Ticks/128) in List 2. The program works just fine so far.

Program terminates by pressing 0 (zero).

So far the students copy the data from the Lists on paper and reenter them in the STAT Lists by hand for further statistical analysis. This is OK for small datasets of 10-20 items. Is there any way at all to copy the C.Basic Lists to CasioBasic Lists so they avoid this tedious work?

My understanding is that since C.Basic works on a different memory space it can't access the CasioBasic Lists. Is there any workaround? For example it would be perfect if I there was a command to copy a C.Basic list to some CasioBasic list. Or even save it to the Main Memory in a compatible format?

Any ideas are acceptable as I'm about to have them start sampling larger datasets for processing.

 

Thanks in advance.

Thanos,

Greece.

Thanks very much for using C.Basic. :D
About data exchange with CasioBasic and List,
There is no built-in function, but it is possible by programming.
 
Transfer from C.Basic List data to CasioBasic can be done in the following way. :)
'ProgramMode:RUN
ClrMat <r>
'#_Str __<r>_,20,1000
""->Str 1
For 1->I To 20
 Dim List I->A
 If A
  Str 1+"{"->Str 1
  For 1->J To A
   Str 1+ToStr(List I[J])->Str 1
   J<A=>Str 1+","->Str 1
  Next
  Str 1+"}Char->List "+ToStr(I)+StrChar(0X0D)+StrChar(0X0A)->Str 1
 
 IfEnd
Next
Save "CPLIST.TXT",Str 1
 
 
'#_Str __<r>_,20,1000
This 1000 is the largest text file size.
Please increase by the size of List.
 
When the program is run, a program of list data is created in text format.
Convert it to g1m format and copy it to the main memory.
If execute the program in CasioBasic, it will be input to the CasioBasic List. :)
 
(example of output text file)
{2,6,6,9,9,9,9,9,9,9}->List 1
{0.5,0.5390625,0.3125,0.3671875,0.3125,0.3125,0.3671875,0.2109375,0.234375,0.3046875}->List 2


#252 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 02 August 2019 - 07:23 AM



Hi,

 

As far as I know, C.Basic uses different interpreter from genuine Casio Basic, thus in fraction or decimal calculations there is an value error. But I don't quite understand because there's actually an unusual way to (may) work. Here are some examples:

 

123.45+67.89

 

You can actually think it as 12345+6789 (=19134), their results looks very similar to each other, except for decimal point. Here, the decimal place value of the answer is 2 (191.34). I think we can just add a decimal point depend on the decimal place value.

 

7.43*12.6

 

Again, it can be like 743*126. This time, the overall decimal place value can be calculated by adding up decimal place value of both (2+1) and getting result of 3, thus 93.168.

 

For 0, I think we can simplify it by adding a detector to check whether the last digit is 0 and it is after decimal point/the decimal place value is not 0.

 

Can this method be possible?

 

Regards,

CalcLoverHK


The internal number format is different as you said. :)
When converting to a string, the rounded numbers are almost the same as CasioBasic, but need to be aware of floating point errors.
123.45->A
67.89->B
A+B=191.34
result is 1
7.43->A
12.6->B
A*B=93.618
result is 0
7.43->A
12.6->B
RndFix(A*B,9)=93.618
result is 1
7.43->A
12.6->B
(A*B-93.618)<0.000000001
result is 1
In C.Basic, it is good to do the conditional expression like the last.
Thanks. :D


#253 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 02 August 2019 - 08:43 AM

As far as I know, C.Basic uses different interpreter from genuine Casio Basic, thus in fraction or decimal calculations there is an value error.

 

Casio Basic uses BCD, binary coded decimal values. That means, all of the decimal ciphers are stored and used in the calculator the same way like visible at the display. Such implementations are robust against rounding / converting errors. But the calculations take much more time.

 

C.Basic uses binary floating point values. There are no decimal ciphers in the internal representation, but binary ciphers. (only 0 and 1 used). They are converted from input and converted for output. This is the normal way compilers tread floating point numbers. It is much more "computer like", calculations are much faster,

 

You can find easily examples, where rather simple decimal fractions lead to infinite binary fractions. The most popular example is 0.1 (decimal). It leads to 1.(1001) × 2-4 . The value in () has to be repeated ad infinite. That is not possible, of course, and a re-transformation may lead to 0.0999999 or so. This can be avoided by BCD, and it is necessary if you use a calculator for trading / commercial calculations. For scientific calculations this is unimportant.


Edited by piu58, 02 August 2019 - 08:46 AM.


#254 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 02 August 2019 - 08:50 AM

@sentaro21,

yes thank you very much. It's very clever to output the lists as CasioBasic commands! Hadn't thought of that! This opens up a large number of possibilities.

 

I'll try it tonight and report back!

 

PS. I see that converting a text file from inside C.Basic can be done from the menu ">g1m" right?

Is there any possibility that in the future there will be some new command in C.Basic to do this programmatically? Say, something like

Txt2G1m "file.txt" "output.g1m"

or similar?

 

Thanks again.

Thanos,

Greece.



#255 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 02 August 2019 - 10:41 AM

@piu58
Thanks! ! :D
 
 
 @tsiozos

PS. I see that converting a text file from inside C.Basic can be done from the menu ">g1m" right?

That's right Ok!

 

Is there any possibility that in the future there will be some new command in C.Basic to do this programmatically? Say, something like

Txt2G1m "file.txt" "output.g1m"

or similar?

I will consider it. :)



#256 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 03 August 2019 - 12:11 PM

I got it. :)

(BTW this thread now has 20000 views and I'm 20000th, congrats!)



#257 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 04 August 2019 - 11:17 AM

Thanks very much CalcLoverHK. :D
 
 
Here are new updated version :)
Newly supports the indent of editor.
There may still be bugs.
Please report as soon as you find it. ^_^
 
2.20 beta for 9860G/9860GII series.
https://pm.matrix.jp...ASIC220beta.zip  (re-uploaded  5/8/2019)
 
1.20 beta for CG10/20/50/Graph90+E.
https://pm.matrix.jp...ICCG120beta.zip  (re-uploaded  5/8/2019)
 
-Added the indent function to the editor.
When EXE is pressed, the indent(blank spaces) at the beginning of the current line is continued to the next line.
 
-In the setup setting, the indent is added automatically when loading the program. (Edit Indent+)
Programs already indented are not added indent.
You can also delete blank spaces including indents when saving program. (=to compatible with Casio Basic)
The following command adds indents.
    If-Else-ElseIf-IfEnd
    For-To-Step-Next 
    While-WhileEnd
    Do-LpWhile
    Switch-SwithEnd
 
-Fixed a bug that did not work Dim List1 using the old command List1.
 
 
(re-uploaded 5/8/2019)
-Fixed the bug that create a new program with an existing file name.

Edited by sentaro21, 05 August 2019 - 09:19 AM.


#258 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 04 August 2019 - 01:53 PM

Automatic indent! that is much more than I thought.

 

One question about if

The if command is slightly unusual in Casio Basic

Instead if

IF mycondition THEN

 

you have to press

 

IF mycondition

THEN

 

or (I do it this way)

 

IF mycondition: THEN

 

My question: Does the editor indent after then in both ways? Or after the if line?

 

In this case I update as fast as possible, probably tomorrow and try that out. I want to support this change as much as possible.



#259 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 04 August 2019 - 02:06 PM

Excellent, sentaro21!
Congrats and thanks on the updated editor.

#260 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 04 August 2019 - 11:03 PM

@piu58

Thanks! :D

My question: Does the editor indent after then in both ways? Or after the if line?

 

In this case I update as fast as possible, probably tomorrow and try that out. I want to support this change as much as possible.

In C.Basic,"Then" can be omitted, so this is the same indent. :)

If <condition>
    Then
    <command>
    <command>
IfEnd
If <condition>:Then
    <command>
    <command>
IfEnd

 

 
@tsiozos
Thanks! :D
About input and output of List data,
In addition to outputting in g1m/g3m format,
I'm thinking about loading and saving in CSV format as same as fx-CG series. :)

 



#261 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 05 August 2019 - 04:58 AM

I just installed it at one of my fx-9860G calcutaors and found a severe error.

 

I tried to make a new program:

NEW (f3) - New program name (iI used Z) -EXE

 

Can't find Z.g1n.g1n (-1)

press exit

 

and after that

 

System error

reboot-exit

initialize-exe

TLB error

target 00..55

PC 00..05

 

Had to remove the batteries.


Edited by piu58, 05 August 2019 - 05:14 AM.


#262 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 05 August 2019 - 05:03 AM

I was able to get a new program by copying an old one. After change the inedn in the setup it works very fine: My firtsly non-indended program was reformatted! Great.

 

I experimented with the if command. THEN ist unnecessary, as you wrote. I tried it:

?->X
If X=0
 9999_
Else
 8888_
Ifend

Thank you fort that. I did not love the strange behaviour of Then.



#263 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 05 August 2019 - 05:53 AM

Hi,

 

I would like to make two suggestions that may have big potenial to programming: Auto-convert appropriate text to command and ability to copy and paste. (I don't know if these features are implemented in C.Basic because I have no time to test it)

 

In general, you have to type the command by tapping buttons in calculators. This is time-consuming. And now we have PC and keyboard to do it in emulator, and guess what? We still need to do completely the same things of calculator! This is impossible when typing a long-script program as it would cost many hours to do it.

 

Therefore, my only hope is having an auto-convert feature and that is enough to save much time.

 

And copy and paste feature, simply Ctrl+C and Ctrl+V and that can save the time you spent on writing programming script.

 

I think these two features is big additions to programming and very likely hardcoded as it consists checking every program bytes.

 

Hope programming will be very convenient in the future.

 

Regards,

CalcLoverHK



#264 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 05 August 2019 - 07:56 AM

I found a bug in the ViewWindow function and Xmin/Xmax variables.

Here's a program to reproduce in v2.10b:

ViewWindow -5,5,1,-2.5,2.5,1
5 -> Xmin

Shows message: "Range ERROR"

This shouldn't be happening.

My guess is tha C.Basic checks the ViewWindow rectangle during Xmin assignment to verify it's sides are not zero. But this causes problems because the user may change Xmax later.

CasioBasic allows any value to be assigned to Xmin, Xmax, Ymin, Ymax and does the range check in the DrawGraph command.


Edited by tsiozos, 05 August 2019 - 07:57 AM.


#265 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 05 August 2019 - 09:17 AM

@piu58
Thanks for a severe bug report! :)
I could confirm that bug.
It is an error to create a new program with an existing file name.
Sorry, it enbuged at 1.98beta and 0.82alpha.
so I fixed it and re-upload now. ^_^
 
I'm happy that the indent feature works well. :D
 
 
 
@CalcLoverHK
C.Basic can handle program text files. :)
The emulator can handle it more conveniently.
 
You import the file from the any PC folder with the emulator once.
Then that folder corresponds to SD mode in C.Basic.
 
After that, please create and run text files that folder. ^_^
 
 
 
@tsiozos
Thanks for a bug report. :)
ViewWindow -5,5,1,-2.5,2.5,1
5 -> Xmin
This is not an error in C.Basic.
In the case of Casio Basic, there is no error at first, but an error in ViewWindow at the second execution.
 
ClrGraph
ViewWindow -5,5,1,-2.5,2.5,1
5 -> Xmin
This is not an error both.
 
ClrGraph
ViewWindow -5,5,1,-2.5,2.5,1
5 -> Xmin
DrawGraph
This is an error both at DrawGraph.


#266 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 05 August 2019 - 11:59 AM

@sentaro21,

No what I mean is that if you do in CasioBasic

ClrGraph
ViewWindow -5,5,1,-2.5,2.5,1
5 -> Xmin
6-> Xmax
DrawGraph

there is no error.

But if you do the same in C.Basic there is still a range errror when the Xmin is assigned and before Xmax is assigned.


Edited by tsiozos, 05 August 2019 - 12:04 PM.


#267 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 05 August 2019 - 12:03 PM

I programmed an example of a dipol field, The magnetic field is always a dipol field, there does not exist a magnetic monopole. I tried whether such a field is similar to an electrostatic field if I put two point charges close together - a positive one and a negative one. Result: This is the same field like the magnetic, except some constant value.

 

The program sketches such a field. I place a small test charge in the near of one of the charges forming the dipole. I calculate the field strength, which is proportional to the force at the test charge. I move the test charge approximately along the streamline until it comes too far away.

 

The program runs at my fx9860G. It should run at the fx-10/20/50 family too.

 

'ProgramMode:RUN
'Field of dipol
1Exp(-)3->d
Gosub G'InitGraph
For 1->i To 16
 0.1->u'left or right?
 Ran#>0.5=>(-)u->u
 u->x
 0.2*Ran#-0.1->y
 Do
  Gosub Q'field strength
  If u<0
   x-.1X/E->x
   y-.1Y/E->y
  Else 'invert charge
   x+.1X/E->x
   y+.1Y/E->y
  IfEnd
  Plot x,y
 LpWhile Abs x<10
Next
Goto S'stop


'=============
Lbl Q'point charges
Input:xdy Output:XYE Used:QRr
Sqrt((x-d/2)^<2>+yy)->R
Sqrt((x+d/2)^<2>+yy)->Q
 (x-d/2)/RRR-(x+d/2)/QQQ->X
 y/RRR-y/QQQ->Y
 Sqrt(XX+YY)->E
Return 


'Envir.f._Graphic
'Init
Lbl G
ClrGraph:CoordOff:AxesOff:GridOff:LabelOff:S-L-Normal:Rad:'#_SketchThin _
'_AxesOn_
ViewWindow (-)10,10,1,-5,5,1
Return 
'Print.XY
Lbl P
Text 1,9,"                                                                                    ":
Text 1,9,x:
Text 1,72,y'9860-72,CG-180
Return 
Lbl S
Plot :Text 1,1,">"Disps


#268 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 05 August 2019 - 03:35 PM

Hi sentaro21,

 

 

@CalcLoverHK
C.Basic can handle program text files. :)
The emulator can handle it more conveniently.
 
You import the file from the any PC folder with the emulator once.
Then that folder corresponds to SD mode in C.Basic.
 
After that, please create and run text files that folder. ^_^

Great! But I still don't quite understand about your steps. :( I have two questions about your procedures.

Does the text document need to edit something to work? Because my program document doesn't use the word like -> or =>.(instead using unicode form →⇒) Then do I need to change the format to .g1m file to import this program?

 

Regards,

CalcLoverHK



#269 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 05 August 2019 - 06:19 PM

Text document are - like the name indicates - pure ASCII. They use replacements for some non-ASCII symbols like the arrow, the unary minus or the stop symbol.

The easiest way to find out how that works is to transmit a real program into ASCII using the >txt command. The text can be downloaded with the FA-124 program for the older calculators or direct via USB for the CG series.

 

If you try to start an ASCII programm it is translated into the internal format first. So you may write program using an ASCII editor, upload it with FA-124 or USB and start. Probably you may make some mistakes first, but ist is more or less straightforward. Keep in mind: All internal symbols start with an uppercase letter. It has to be Sin, Log and Sqrt, and not sin, log and sqrt like in C or Visual Basic.



#270 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 06 August 2019 - 01:50 AM

@tsiozos
Ok! :)
There seems to be some suspicious bug of TΘPitch.
ClrGraph
ViewWindow -5,5,1,-2.5,2.5,1,0,1,1
5 -> Xmin
DrawGraph
Will this be an error?
 
 
 
@piu58
Thanks for new interseted program. :D
I like seeing these shapes.
It is a program that can be used practically at the speed of C.Basic.(Especially CG ver.) ^_^
 
 
 
@CalcLoverHK
Currently, text conversion supports only ascii code text.
The conversion rules are based on the CG20/CG50.
Please refer to CG20/50 manual Chapter 8-8(text Conversion Table). :)
 


#271 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 06 August 2019 - 05:36 AM

For all interested in the small piece of theory behind the dipol field program, here some outline oft it.

BTW: Is there a way to store images in the forum database?

dipol.jpg



#272 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 06 August 2019 - 05:56 AM

@sentaro21,

yes this should be an error because Xmin equals Xmax after 5->Xmin and the rectangle defined has zero width.

But this

ViewWindow -5,5,1,-2,2,1
5->Xmin
-3->Xmin
DrawGraph

should not be an error because Xmin changes back to a legal value BEFORE DrawGraph is called. But in C.Basic in the "5->Xmin" command it throws a "RANGE" error and stops. It shouldn't.



#273 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 06 August 2019 - 05:59 AM

I made a slightly different version of the program. Streamlines are closed. In this version I sketch them until they reach the starting point (are close to it).

 

Some streamlines move fare away from the origin. I made a small trick - if I see that x or y is larger then 10, i set it of the returning path. 

  Abs x>10=>(-)x->x
  Abs y>10=>(-)y->y

Purists may omit these lines. The program calculates longer then.

 

I omitted the graphic library and the calculation of the field strength. They are the same as in the first listing.

 

'Field of dipol v2
1Exp(-)3->d
Gosub G'InitGraph
For 1->i To 100
 0.1->u'left or right?
 Ran#>0.5=>(-)u->u
 u->x
 0.2*Ran#-0.1->y
 Do
  Gosub Q'field strength
  If u<0
   x-.1X/E->x
   y-.1Y/E->y
  Else 'invert charge
   x+.1X/E->x
   y+.1Y/E->y
  IfEnd
  Plot x,y
  Abs x>10=>(-)x->x
  Abs y>10=>(-)y->y
  Sqrt(xx+yy)->r
 LpWhile r>0.1'_Abs _x<10
Next
Goto S'stop


#274 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 06 August 2019 - 07:48 AM

@tsiozos
I tried it with the previous version.
Before 1.99b, it's an error as you say.
It seems that it has been corrected in 2.00b.
in 2.10b or 2.20b, an error does not appear.
Could you try again in 2.20b? ^_^
 
 
@piu58
Thanks for outline and new version. :D
It is interesting that the image is different every time depending on the random number.


#275 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 06 August 2019 - 07:58 AM

Hi sentaro21,

 

Does the Casio Basic generates a number of random number depend on the number of the variable assigned?

 

Like RanInt(0,9)→A~D:

If the RanInt(0,9) generates 4, does it mean assign 4 to A-D? Or generates different numbers to different variables?

If not, can you please add this feature to C.Basic?

 

Regards,

CalcLoverHK


Edited by CalcLoverHK, 06 August 2019 - 07:58 AM.


#276 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 06 August 2019 - 09:29 AM


Hi sentaro21,

 

Does the Casio Basic generates a number of random number depend on the number of the variable assigned?

 

Like RanInt(0,9)→A~D:

If the RanInt(0,9) generates 4, does it mean assign 4 to A-D? Or generates different numbers to different variables?

If not, can you please add this feature to C.Basic?

 

Regards,

CalcLoverHK

 

RanInt#(0,9)->A~D
If result of RanInt(0,9) is 4,
A~D variables is 4.
 

To set random numbers for A~D variables,
This is a trick of C.Basic,
Assign a variable address to List and enable variable access in List. ^_^
'#CBCPLX
4->Dim Dim List 1(VarPtr(A))
RanInt#(0,9,4)->List 1
Since all double variables are complex, they must be run in complex mode.
 
In integer mode, it can be processed with integers only.
'#CBINT
4->Dim Dim List 1(VarPtr(A))
RanInt#(0,9,4)->List 1
 
The variable is assigned like this.
A = List 1[ 1]
B = List 1[ 2]
C = List 1[ 3]

D = List 1[ 4]



#277 tsiozos

tsiozos

    Casio Fan

  • Members
  • PipPip
  • 42 posts

  • Calculators:
    fx-9860gII

Posted 06 August 2019 - 07:07 PM

@sentaro21,

sorry to say it's still not working with v. 2.20b.

 

Here's the image:

https://ibb.co/ZmzChHP

 

The same exact program produces the function diagram in CasioBasic.

 

The error in C.Basic happens at the 5->Xmin command.


Edited by tsiozos, 06 August 2019 - 07:08 PM.


#278 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 07 August 2019 - 02:54 AM

@sentaro21,

sorry to say it's still not working with v. 2.20b.

 

Here's the image:

https://ibb.co/ZmzChHP

 

The same exact program produces the function diagram in CasioBasic.

 

The error in C.Basic happens at the 5->Xmin command.

@tsiozos
Thanks very much! :D
The same bug happenoed here.
so,I fixed a bug and updated. ^_^
 
2.21 beta for 9860G/9860GII series.
        -Fixed "Range Error" when assigned directly to ViewWindow variable.
        -hange specification that Graph 35+E II hidden memory usable size has been changed from 128KB to about 188KB.
        -Fixed a bug that the SDK emulator could not be started after initialization.
 
1.21 beta for CG10/20/50/Graph90+E.
        -Fixed "Range Error" when assigned directly to ViewWindow variable.


#279 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 257 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 07 August 2019 - 03:43 AM

Hi sentaro21,
 

'#CBINT
4->Dim Dim List 1(VarPtr(A))
RanInt#(0,9,4)->List 1

Is the 4->Dim Dim List a typo? If not then why are there two "Dim"?
 

The variable is assigned like this.
A = List 1[ 1]
B = List 1[ 2]
C = List 1[ 3]
D = List 1[ 4]

If I want to use/access the list variables in program mode, do I need to use just like List 1[ 1]->A?

Thanks for answering my many questions as you can.

Regards,
CalcLoverHK


Edited by CalcLoverHK, 07 August 2019 - 03:45 AM.


#280 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 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 07 August 2019 - 04:05 AM

Is the 4->Dim Dim List a typo? If not then why are there two "Dim"?

It is a extended command to change the size without changing the contents of Mat and List. :D

 

If I want to use/access the list variables in program mode, do I need to use just like List 1[ 1]->A?

In this case,
List 1 [ 1] has the same value as A.
When A is changed, List 1 [ 1] is also changed.
If List 1 [ 1] is changed, A is also changed.
In other words, the same area is accessed inside the C.Basic. ^_^






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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users