Hex To Decimal Conversion Issues

I corrected some other errors and now have a single integer returned as the result, however for 7DE the integer returned is 3799 rather than the correct answer, 2014.

Convert
ED7 = 3799

2 Likes

Listed below is the final working code. I needed to do the list reversal at the beginning, which should have been extremely obvious in the first place (but wasn't). Thank you Juan_Antonio and ABG for guiding me in the right direction

Now that you've got yours working, I can show you a recursive solution ...

caboose shorten digit_value
math.aia (31.1 KB)

1 Like

Very cool. I'm not sure why the call blocks auto-populated in the procedures drawer don't have the "call" label on them, nor why I don't have the "do it" option to test.

Are you Connected to the Companion?

Capture
For the value procedures (nipple on the left), their name identifies them in expressions that invoke their vales.
For non-value procedures (no nipple), a call verb is needed and provided.

Another code for bases from 2 to 16, changing the base variable.

2 Likes

I connected to the emulator and got the correct result, though "call" still does not appear

It's time for you to read Chapter 21 of the free book
http://www.appinventor.org/bookChapters/chapter21.pdf
from
http://www.appinventor.org/book2
from

Everything I gave you was a function, like sin() or cos() or max(), which typically don't use the verb CALL in their definition or their invocation.

CALL would be used in a subroutine, like
Call Start_World_War_III
but not in the definition of the subroutine

  • Target Missiles
  • Launch Missiles
  • enter bunker
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.