Post Reply 
a type bug
11-30-2015, 10:01 PM (This post was last modified: 11-30-2015 10:03 PM by Han.)
Post: #2
RE: a type bug
(11-30-2015 09:53 PM)ji3m Wrote:  In the cas window, 'type ("abc")' returns DOM_STRING which is 12

But in a program

EXPORT yup()
BEGIN
LOCAL a := "abcder",Z;
Z :=CAS("LEFT(a,3)");
{Z, CAS.type (Z), TYPE (Z)};
END;

in cas wibdow , 'a:= yup' gives {"abc", 6, 2}

The cas type returned is 6 which is DOM_IDENT. but its
clearly a string.

Nasty workaround checks TYPE also.

That's because CAS.command() takes strings as arguments in order to be able to pass "symbolic" arguments (which would not be possible without strings). Thus, when you do CAS.type("abc") you are actually executing: type(abc). And if 'abc' does not exist, then the type returned is that of a variable name.

http://www.hpmuseum.org/forum/thread-3590.html

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
a type bug - ji3m - 11-30-2015, 09:53 PM
RE: a type bug - Han - 11-30-2015 10:01 PM
RE: a type bug - ji3m - 11-30-2015, 10:42 PM
RE: a type bug - Han - 12-01-2015, 12:01 AM
RE: a type bug - ji3m - 12-01-2015, 05:24 PM



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