HP Forums

Full Version: Casio 7400gII
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
i'm actually just a software user, but i'm currently trying my hand at programming Casio-Basic (Casio 7400gII; Casio 9860gII) and Sharp-Basic (PC 1403; e500).
I also own a couple of HP calculators; I use a HP 48sx daily in the office.

I have the following program:
Code:
   Lbl 1
   Cls
   RanInt#(1,7)->A
   RanInt#(1,16)->B
   Locate B,A, "Hello"
   Getkey != 47 => Goto 1
Unfortunately the program does not do what i want.
Before each loop the display should be cleared [cls].
Currently the calculator is cluttering up the display, which is not what i want.
Where am I making a mistake?
Can someone help me ?
Thanks a lot
Use ClrText. Cls clears the graphics screen.
<clrtext> i had already tried. Unfortunately it does not bring the desired result. Because the loop runs through too fast, no text appears.

I think that i have to add a wait loop when using <clrtext>.
Let's see if i can do that. I have unfortunately still no experience in programming.
Key 47 is exit.
I am pretty sure this command cannot interrupt the program so the loop will run till you hit AC button
Using the correct symbol for the relational operator "not equals" when checking GetKey for 47 then the program runs correctly on my FX-CG50 and terminates on pressing the EXIT key.

It also runs on a real CFX-9860G and an emulated FX-9860G. These do not have RanInt# so I changed the code to (for example) INT(Ran#*7)+1 from RanInt#(1,7)

I do not have a FX-7400GII, but looking at the manual I see no reason why it should not work.
Do
GetKey ->K
RanInt#(1,7)->A
RanInt#(1,16)->B
Locate B,A, "Hello"
LpWhile K<>47

<> means not equal
Thanks for your efforts.

(04-27-2022 10:04 AM)Hollerith Wrote: [ -> ]Using the correct symbol for the relational operator "not equals" ...

I'm using the right symbol, I just didn't know how to represent it here, so I took "!="

(04-27-2022 10:04 AM)Hollerith Wrote: [ -> ]...It also runs on a real CFX-9860G and an emulated FX-9860G ...

I have seen that the program runs on a Casio 5800p and as tested by you on a 9860g.
There have certainly been changes in the Casio OS. The 9860gII now also has RanInt#, ..., and "cls" has been changed.

(04-27-2022 11:37 AM)klesl Wrote: [ -> ]Do
GetKey ->K
...

I am sorry, but the program does not do what I want:
1. clear display
2. "Hello" on display (Random)
3. delete display
4. "Hello" at another place on display (Random)
5. delete display
6. and so on
Therefore I used "cls" or tried "ClrText".

Now my ambition is awakened
I'll replace "cls" with "clrText" next, and try to include a wait loop in my program above.
I think this will work as I want it to.

addendum: I use a translator
Well, you are displaying HELLO and clearing the HELLO during one loop, so the results is blank screen with displayed busy indicator (square at the top right corner), because the disaplaying HELLO and clearing it runs practially in the same moment.
Unfortunately there is no Pause command in current Casio Basic, so you need to insert between locate and clrtext some loop, e.g. summation, factorial, product, addition, substraction, factorization, to see the "HELLO" for certain time before clearing it.
This is exactly what I meant in my post no. 3
(04-26-2022 01:57 PM)Pälzer Wrote: [ -> ]I think that i have to add a wait loop when using <clrtext>

short subtraction loop inserted, program works as desired.
Thanks

edit: 2nd paragraph inserted
Great :-)
Reference URL's