-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|618|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> dec 2 hex?

Posted : Thursday, 08 June 2017, 05:28
TomToad
Print Hex(43981)
Posted : Thursday, 08 June 2017, 05:32
rychan
ABCD?
Posted : Thursday, 08 June 2017, 12:37
steve_ancell
I just dug this out of the sourcecode of my Mutant Monty project, it's Monkey-X code but it shouldn't be too hard to convert to the proggy language you are using.


---
LOL. I just realised you want it the other way around, I will still leave this snippet here though just in case you need that too.
Posted : Thursday, 08 June 2017, 12:46
steve_ancell
Have I missed the plot here though, are you asking for a way to convert hex to decimal or are you pulling our pilsners?. I just thought I needed to ask that due to there already being a Hex$ function in Blitz.
---
Although with the way my head is malfunctioning lately, I have more than likely missed the plot.
---
With that aside, welcome to SoCoder.
Posted : Thursday, 08 June 2017, 16:41
TomToad
Seems a bug in the forums created some confusion. Spinal made the topic "dec 2 hex?" but left the body of the post blank. I responded with showing the Hex$ command. Seems the blank post then gets deleted making it look like I started the topic, when in reality I'm just the first reply.
Posted : Thursday, 08 June 2017, 17:01
Jayenkai
They're not bugs...
They're "features"


I might have to create a couple of those for Socoder2 testing.
Hopefully the new daily "rescan" feature should help to dispel this sort of bug in the future. Deleting was never something I was good at!

-=-=-
''Load, Next List!''
Posted : Thursday, 08 June 2017, 18:12
steve_ancell
Ahh, now that explains it. Well that confirms that I missed the plot.
Posted : Tuesday, 13 June 2017, 02:49
hardcoal22
I remember as a kid I did a hex to decimal and octa translator on commodore 64

I also done a formula like X2+(4X+45)=2X solver..
it was cool for those days..

but I had no one to value this properly what a shame
Posted : Tuesday, 13 June 2017, 03:46
steve_ancell
What's weird with me though, a Hex2Dec function seemed fairly straight forward to make and yet I haven't a scooby on how to do it the other way around.
---
I should imagine it would entail cutting the integer into 4-bit pieces and then converting each one of those into each alpha-numeric, I've never really looked into it though.
Posted : Tuesday, 13 June 2017, 08:26
TomToad
@steve_ancell, if the built in Blitz version doesn't work for you, you can modify this version that only works on Ints and leaves the leading 0s
Edit: Modified the code so now you can pass false to the second parameter to remove the leading zeros.

Posted : Tuesday, 13 June 2017, 08:38
steve_ancell
It wasn't that the Blitz version worked or not, I was just curious. I managed to knock-up a Monkey-X version of Hex2Dec a few years back, that was just so that I could write hexadecimal as pairs into a text editor to represent the map for when I did Mutant Monty.

On the other hand thanks for the snippet you just posted, it may come in handy at some point.
Posted : Tuesday, 13 June 2017, 14:53
spinal
Wait what? I created an empty post? When? That doesn't sound like me...

-=-=-
Download ''Don't Flip Out!'' Directly to your OUYA! (Click Here).
Posted : Tuesday, 13 June 2017, 15:02
Jayenkai
You started the topic, then deleted the post. The way the forum works, with topics and posts being separate entities, the topic remained, even though it had no posts.
It never showed up in the sidebar because no "latest post" was made, but the empty topic remained in the standard forum browsing area...

-=-=-
''Load, Next List!''