Register

Dim Error on empty List

Discuss anything related to calculators. For specific help on certain games/programs check the Released Projects subforum.
Member
Posts: 27
Joined: Fri Aug 28, 2015 5:10 am
Calculators: Casio fx-9750G PLUS, Casio fx-9750GII (SH4)

Dim Error on empty List

Postby brickviking » Wed Sep 23, 2015 11:20 am

I've found one small bug or lack of functionality, with no real way to work around it. If a List happens to be empty (no values), and I try retrieving any information about that list from within a program (Dim List n), I get Dimension Error on the fx-9860GII (or simply Dim Error on the fx-9750G+). I can't test for a non-present list without running into the aforementioned Dimension Error. Does anyone know a way around this?

(Post 12)
Regards, BrickViking

Senior Member
Posts: 100
Joined: Sun Mar 24, 2013 12:01 pm
Calculators: None

Re: Dim Error on empty List

Postby TeamFX » Wed Sep 23, 2015 1:50 pm

There is a trick on fx-9860G/GII and FX 1.0/2.0 models:

10->Z // expected list size
Getkey=79=>Z->Dim List 1 // initial setup
Z->List 1[1] // overwrite or create first cell
Dim List 1=/=List 1[1]=>"Error"

So the first list cell cannot be used and is always overwritten.
I would also recommend to store a magic number or checksum in the last list cell, in case there is another list with the same size but incompatible data.
Last edited by TeamFX on Fri Sep 25, 2015 5:26 pm, edited 1 time in total.

Senior Member
Posts: 100
Joined: Sun Mar 24, 2013 12:01 pm
Calculators: None

Re: Dim Error on empty List

Postby TeamFX » Wed Sep 23, 2015 5:14 pm

If you're interested in Casio-Basic programming, have a look here for more tricks:
http://community.casiocalc.org/topic/54 ... -from-cfxm

Last post contains the corrected Omnimaga links.

Member
Posts: 27
Joined: Fri Aug 28, 2015 5:10 am
Calculators: Casio fx-9750G PLUS, Casio fx-9750GII (SH4)

Re: Dim Error on empty List

Postby brickviking » Thu Sep 24, 2015 11:22 am

TeamFX wrote:There is a trick on fx-9860G/GII and FX 1.0/2.0 models:

10->Z // expected list size
Getkey==79=>Z->Dim List 1 // initial setup
Z->List 1[1] // overwrite or create first cell
Dim List 1=/=List 1[1]=>"Error"

So the first list cell cannot be used and is always overwritten.
I would also recommend to store a magic number or checksum in the last list cell, in case there is another list with the same size but incompatible data.


Um, I'm confused, so I've got some questions.
  • What's the GetKey for?
  • Is =/= actually [NOT EQUAL] and == is [EQUAL]?
  • And, does this count on me having a List element 0 assigned for the expected list?
  • One last thing, will this work on a fx9750G+, or just the fx9860G/GII ?

(Post 13)
Regards, BrickViking

Senior Member
Posts: 100
Joined: Sun Mar 24, 2013 12:01 pm
Calculators: None

Re: Dim Error on empty List

Postby TeamFX » Fri Sep 25, 2015 5:17 pm

What's the GetKey for?

Go to the PRGM menu and start your program by pressing [F1].
[F1] is often used for setup/installation purposes in Casio-Basic programs.

=/= is the unequal sign.
== was C syntax, I fixed that.

List 1[0] can contain a subject name but it doesn't matter if there is one or not.
"Stuff"->List 1[0] will also create List 1[1] if the list did not exist.

This will not work on an fx-9750G or CFX.

Return to General

Who is online

Users browsing this forum: Google [Bot] and 38 guests