The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Get "de-string" an expression
03-09-2015, 01:11 PM (This post was last modified: 03-09-2015 01:22 PM by Angus.)
Post: #1
Get "de-string" an expression
When given a String like "#AAh". How can that be changed to an integer constant #AAh?
I had in mind that CAS(String) is a way to convert a String to its (cas)meaning. Is that right? And why would that not work in the given example.
Please also look at the code:

Code:
EXPORT INT_HEX(X)
BEGIN
  CASE
    IF TYPE(X)==0 THEN R→B(X,32,4); END;
    IF TYPE(X)==1 THEN SETBASE(X,Base); END; //Base has already been set to 3
    IF TYPE(X)==2 THEN  CAS("#"+X+"h"); END; //input String like "AA" should return #AAh
    DEFAULT "";
   END;
 // R→B(X,32,4);
END;

edit: remembering Han's tutorial about cas programs I tried locally assigning str:="#"+X+"h"; CAS(str); which SEEMS to work better, but apparently always leads to everything but the desired result.... dec semms to be preferred.

Can someone help with the functionality I am looking for?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Get "de-string" an expression - Angus - 03-09-2015 01:11 PM
RE: Get "de-string" an expression - Angus - 03-09-2015, 01:24 PM
RE: Get "de-string" an expression - DrD - 03-09-2015, 01:56 PM
RE: Get "de-string" an expression - Angus - 03-09-2015, 02:02 PM
RE: Get "de-string" an expression - DrD - 03-09-2015, 02:17 PM
RE: Get "de-string" an expression - Angus - 03-09-2015, 02:38 PM
RE: Get "de-string" an expression - Angus - 03-10-2015, 05:47 AM



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