Decimal to Hex Function return

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: Decimal to Hex Function return

Post by Henko »

GeorgeMcGinn wrote:
Sat Feb 16, 2019 11:31 pm
Why does everyone like doing things the hard way?
Because the rest of the world is not as smart as you are, George 😂.
Two specific issues where brought up. The question if sB has a HEX function was not among them.
Nevertheless thanks to remind us of the existance.
But no need to explicitely express your excellency (all spelled well?)

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Decimal to Hex Function return

Post by Dutchman »

About function return-value as string:
matt7 wrote:
Tue Feb 12, 2019 6:46 pm

I struggled to figure this out myself a while ago. This really should have been explained in the documentation on the "Basic" page under "User Functions." (I pretty much only use the in-app documentation, but maybe this is already in the PDF version that gets updated by Dutch.)
I have added a note in the PDF-manual on page 15:
If the return-value is a string, then the function-name should end with '$'.
Example:

Code: Select all

DEF spaces$(n) ' return string with n spaces
a$=""
FOR i=1 TO n
  a$&=" "
NEXT i
RETURN a$
END DEF

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: Decimal to Hex Function return

Post by GeorgeMcGinn »

No need for accolades 🤡

The one benefit of learning to do it long-hand is if a language does not have the HEX statement.

One of TechBASIC's sample program had a serious bug because it was coded the hard way, and the only way I convinced him was to use his built-in HEX function!

I only mentioned it for our new members!

😃
Henko wrote:
Sun Feb 17, 2019 8:44 am
GeorgeMcGinn wrote:
Sat Feb 16, 2019 11:31 pm
Why does everyone like doing things the hard way?
Because the rest of the world is not as smart as you are, George 😂.
Two specific issues where brought up. The question if sB has a HEX function was not among them.
Nevertheless thanks to remind us of the existance.
But no need to explicitely express your excellency (all spelled well?)
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

Speedbart
Posts: 4
Joined: Sat Jan 12, 2019 11:17 pm
My devices: iPhone, iPad, MacBook
Location: Plymouth UK
Flag: Great Britain

Re: Decimal to Hex Function return

Post by Speedbart »

Oh dear god how did I not see that - and I felt stoopid not spotting the % conversation - thanks / sorry!

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Decimal to Hex Function return

Post by rbytes »

We all make mistakes like that. I keep discovering and rediscovering commands, handy subs and functions that I recall using and then forgetting.
The only thing that gets me down is gravity...

Post Reply