Post Reply 
Base Conversion
05-12-2016, 07:12 PM (This post was last modified: 05-12-2016 07:21 PM by salvomic.)
Post: #11
RE: Base Conversion
(05-12-2016 06:49 PM)Stevetuc Wrote:  Salvo, This works with both Baseconv(255) and Baseconv(#255d)
Hopefully no introduced bugs!

hi Stevetuc,
it's ok to overcome the error but there is a last thing to solve:
Baseconv(255) is seen always as it was Baseconv(#255h), as hex, so
Baseconv(255) -> Hex -> Input return #255h and not the correct #FFh, I think that user mean 255 *is* decimal, otherwise it would have write #255h (597d) :-)
With this code
Code:
IF LEFT(STRING(in),1) ≠ "#" THEN in:=EXPR("#"+in+"d") END;
it works interpreting 255 as decimal.
But... But if the user inputs
Baseconv(#255) still the code interprets as #255h (it adds the "h" for hex) :-)
In this case, maybe the user really means to say "#255h", otherwise he/she doesn't put the "#" first...

However, besides that, it's ok!
thank you
Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Base Conversion - Stevetuc - 05-12-2016, 06:46 AM
RE: Base Conversion - jrozsas - 05-12-2016, 09:21 AM
RE: Base Conversion - salvomic - 05-12-2016, 09:55 AM
RE: Base Conversion - jrozsas - 05-12-2016, 01:10 PM
RE: Base Conversion - salvomic - 05-12-2016, 01:13 PM
RE: Base Conversion - Stevetuc - 05-12-2016, 02:11 PM
RE: Base Conversion - salvomic - 05-12-2016, 02:27 PM
RE: Base Conversion - Stevetuc - 05-12-2016, 04:42 PM
RE: Base Conversion - salvomic - 05-12-2016, 04:52 PM
RE: Base Conversion - Stevetuc - 05-12-2016, 06:49 PM
RE: Base Conversion - salvomic - 05-12-2016 07:12 PM
RE: Base Conversion - Stevetuc - 05-12-2016, 07:26 PM
RE: Base Conversion - salvomic - 05-12-2016, 07:31 PM
RE: Base Conversion - Eddie W. Shore - 06-07-2016, 01:08 PM
RE: Base Conversion - Stevetuc - 06-09-2016, 03:22 PM
RE: Base Conversion - salvomic - 06-09-2016, 03:33 PM
RE: Base Conversion - Stevetuc - 06-10-2016, 09:19 AM
RE: Base Conversion - JDW - 08-16-2018, 03:56 AM
RE: Base Conversion - Tyann - 08-16-2018, 05:36 AM
RE: Base Conversion - JDW - 08-16-2018, 10:02 AM
RE: Base Conversion - Stevetuc - 08-16-2018, 11:21 AM
RE: Base Conversion - JDW - 08-16-2018, 11:43 AM
RE: Base Conversion - Stevetuc - 08-16-2018, 12:19 PM
RE: Base Conversion - JDW - 08-17-2018, 01:46 AM
RE: Base Conversion - Stevetuc - 08-17-2018, 04:13 AM
RE: Base Conversion - salvomic - 06-10-2016, 09:51 AM
RE: Base Conversion - Stevetuc - 06-11-2016, 07:53 AM



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