Post Reply 
Use the appropriate "Ans" in a program in HOME or CAS
11-16-2015, 03:17 PM
Post: #3
RE: Use the appropriate "Ans" in a program in HOME or CAS
(11-16-2015 06:33 AM)cyrille de brébisson Wrote:  ...
Sorry, but at this point in time, there is no way to detect if you are in home or CAS and therefore no way to choose the right Ans..
...

Well... I might have found a way to doit. You might not like it but me, I will use it. It seems to basically works from the last thirty minutes tests I've done.

Here is the trick: when we're in CAS, in the top left of the screen it shows in WHITE the word "CAS".

So I though about reading back the pixel at coordinates (15,13) which is in the "C" of CAS. If this pixel is WHITE, then we're in CAS. If this pixel is not WHITE then we're not in CAS.

So by having a routine checking the color of that pixel I can determine if I am in CAS or not, and so, take from the start the appropriate answer (CAS.Ans or Ans).

I tested it with various settings like both color theme "dark" and "light", different color for highlight menu, the three font size small, medium and large, etc. It seems to work in every situations. Ha! Ha!

At least, it's better than having nothing.

Sounds good? :-)

Dennis.

Code:

EXPORT MyCalc_isCAS
BEGIN 
 LOCAL MyTestPixels; //Looks like we need to go through a variable though.
 MyTestPixels:=GETPIX_P(15,13);
 if MyTestPixels=RGB(255,255,255) THEN
  RETURN 1;
 ELSE
  RETURN 0;
 END;
END;

Denis Bisson
Little electronic technician loving calculators
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Use the appropriate "Ans" in a program in HOME or CAS - explorerchess - 11-16-2015 03:17 PM



User(s) browsing this thread: 1 Guest(s)