Post Reply 
[CAS] Inconsistency with commands.
10-28-2016, 11:26 PM
Post: #1
[CAS] Inconsistency with commands.
Sorry for yet another post guys but,

I am getting confused about the difference between uppercase and lowercase commands. For some cases there doesn't seem to be a difference.
STRING(); works the same as string();
LOCAL; works the same as local; **I think...**

But in other commands, they act a bit weird. I have found 2 so far:
Code:
#cas
char_program(input):=
BEGIN
  return char(input);
END;
#end
Inputing 8730 returns an empty box. Apparently, I've used the wrong case for "CHAR". This is despite how in CAS mode, when you select the "CHAR" command from Toolbox > Catlg > "CHAR", it is given to you in lowercase. In this case, only CHAR works.

Code:
#cas
expr_program(input):=
BEGIN
  return EXPR(input);
END;
#end
Inputing "a" returns "Error: Syntax Error". Instead of EXPR, expr is needed here. Although selecting "EXPR" from the CAS toolbox does give it in lowercase, it is displayed in uppercase in the catalog.

What is the difference between the cases, and how should I know which one to use?
Find all posts by this user
Quote this message in a reply
10-29-2016, 06:19 AM
Post: #2
RE: [CAS] Inconsistency with commands.
In CAS, you should use lowercase. char/asc is working in ASCII (8 bits char) extended to UTF8, while HOME is using UTF16 (16 bits char). For example
asc("a") returns a list of 1 integer
asc("é") returns a list of 2 integers
and char does the reverse.
Which means that the sqrt symbol is coded inside CAS with UTF8 corresponding to UTF16=8370, that is with 3 integers 226, 136, 154, that you get with asc.
Find all posts by this user
Quote this message in a reply
10-29-2016, 08:01 AM
Post: #3
RE: [CAS] Inconsistency with commands.
(10-29-2016 06:19 AM)parisse Wrote:  In CAS, you should use lowercase. char/asc is working in ASCII (8 bits char) extended to UTF8, while HOME is using UTF16 (16 bits char). For example
asc("a") returns a list of 1 integer
asc("é") returns a list of 2 integers
and char does the reverse.
Which means that the sqrt symbol is coded inside CAS with UTF8 corresponding to UTF16=8370, that is with 3 integers 226, 136, 154, that you get with asc.

Okk, thanks for clarifying.
Find all posts by this user
Quote this message in a reply
Post Reply 




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