Edited by sentaro21, 22 July 2019 - 12:42 PM.
#241
Posted 20 July 2019 - 08:45 AM
#242
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
Posted 24 July 2019 - 07:55 AM
#244
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
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!
#246
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
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
- - - (LOGIC)
#248
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
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
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
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.
'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
{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
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
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
#253
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
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
Posted 02 August 2019 - 10:41 AM
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
Posted 03 August 2019 - 12:11 PM
I got it.
(BTW this thread now has 20000 views and I'm 20000th, congrats!)
#257
Posted 04 August 2019 - 11:17 AM
Edited by sentaro21, 05 August 2019 - 09:19 AM.
#258
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
Posted 04 August 2019 - 02:06 PM
Congrats and thanks on the updated editor.
#260
Posted 04 August 2019 - 11:03 PM
@piu58
Thanks!
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
#261
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
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
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
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
Posted 05 August 2019 - 09:17 AM
ViewWindow -5,5,1,-2.5,2.5,1 5 -> Xmin
ClrGraph ViewWindow -5,5,1,-2.5,2.5,1 5 -> Xmin
ClrGraph ViewWindow -5,5,1,-2.5,2.5,1 5 -> Xmin DrawGraph
#266
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
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
Posted 05 August 2019 - 03:35 PM
Hi sentaro21,
@CalcLoverHKC.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
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
Posted 06 August 2019 - 01:50 AM
ClrGraph ViewWindow -5,5,1,-2.5,2.5,1,0,1,1 5 -> Xmin DrawGraph
#271
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?
#272
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
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
Posted 06 August 2019 - 07:48 AM
#275
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
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
'#CBCPLX 4->Dim Dim List 1(VarPtr(A)) RanInt#(0,9,4)->List 1
'#CBINT 4->Dim Dim List 1(VarPtr(A)) RanInt#(0,9,4)->List 1
D = List 1[ 4]
#277
Posted 06 August 2019 - 07:07 PM
@sentaro21,
sorry to say it's still not working with v. 2.20b.
Here's the image:
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
Posted 07 August 2019 - 02:54 AM
@sentaro21,
sorry to say it's still not working with v. 2.20b.
Here's the image:
The same exact program produces the function diagram in CasioBasic.
The error in C.Basic happens at the 5->Xmin command.
#279
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
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.
If I want to use/access the list variables in program mode, do I need to use just like
List 1[ 1]->A
?
Also tagged with one or more of these keywords: Casio Basic C.Basic
General →
Your Projects →
Inside Casio Basic is now to be preparedStarted by Krtyski , 02 Dec 2016 Casio Basic C.Basic |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users