Post Reply 
Can you check for string parameters without a magic number?
11-16-2017, 07:09 AM
Post: #3
RE: Can you check for string parameters without a magic number?
Using type instead of TYPE even though I am in PPL not CAS doesnt seem to help

Code:

EXPORT STRINGMAGIC()
BEGIN
 PRINT();
 PRINT(IFTE(TYPE(12.5)==DOM_FLOAT-1,STRING('DOM_FLOAT'),"NOT"));
 PRINT(IFTE(TYPE(#12)==DOM_INT-1,STRING('DOM_INT'),"NOT"));
 PRINT(IFTE(TYPE("ST")==DOM_STRING-1,STRING('DOM_STRING'),"OOPS"));
 PRINT(IFTE(TYPE("ST")==3-1,"It IS a THREE, NOT A STRING","OOPS"));
 PRINT(IFTE(TYPE({})==DOM_LIST-1,STRING('DOM_LIST'),"NOT"));
 PRINT(type(12.5)==DOM_FLOAT-1);
 PRINT(type(#12)==DOM_INT-1);
 PRINT(type("ST")==DOM_STRING-1);
 PRINT(IFTE(type("ST")==DOM_STRING-1,"It IS A STRING","NO, IT IS NOT A STRING "+type("M")));
 PRINT(type({})==DOM_LIST-1);

END;
What am I missing?

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Can you check for string parameters without a magic number? - StephenG1CMZ - 11-16-2017 07:09 AM



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