BBC BASIC for Windows
« Decimal to Hexadecimal converter (Tool) »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:10pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Decimal to Hexadecimal converter (Tool)  (Read 342 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Decimal to Hexadecimal converter (Tool)
« Thread started on: Mar 28th, 2016, 06:35am »

This should be right. Now you can make those fast Hexadecimals in your program..
Its ready to compile and then you can execute it, and resize the window and place it where you want for quick conversion..
Code:
  
 10 PRINT
   20 PRINT "Enter a number "
   30 INPUT number
   40 PRINT "The hexadecimal is :"
   50 PRINT "&"+STR$~(number)
   60 PRINT "Press ENTER to clear the screen and convert more"
   70 INPUT A$
   80 CLS
   90 GOTO 10
 
« Last Edit: Mar 28th, 2016, 07:43am by michael » User IP Logged

I like making program generators and like reinventing the wheel
Zaphod
Guest
xx Re: Decimal to Hexadecimal converter (Tool)
« Reply #1 on: Mar 28th, 2016, 4:14pm »

I am wondering why you would not just go to immediate mode and type PRINT ~123 or PRINT &7B to convert in either direction. It seems pretty simple to me or am I missing some vital point.
User IP Logged

michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: Decimal to Hexadecimal converter (Tool)
« Reply #2 on: Mar 28th, 2016, 4:37pm »

Quote:
Hex is so embedded in computers that BBC BASIC will even print it for us. In order to convert a number in decimal to a string representation in hex use STR$ with tilde:

PRINT STR$~(255)

To convert a number back from hex to decimal use:
PRINT EVAL ("&FFE")


This is my source.
I am still trying to learn. I make modules from what I learn and apply and improve the modules as I advance in programming technique.
Also, this tool became necessary for me since Richard told me of a more efficient way to do calculations.

I needed a tool to convert decimal to hexadecimal.. and so this became the quick solution..
Also there may be a future use for this tool in other projects.. (no idea)
Immediate mode.. I found it.. thanks..
« Last Edit: Mar 28th, 2016, 5:32pm by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls