 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
|
|
What would you do without Source code? |
|
|
|
If you plan to use this source for any purpose to distribute, shareware OR freeware, Please click here. |
|
|
|
Don't worry, It's only a few lines long and no capital letters. It's safe. I just ask that you inform me if you plan to use anything here for anything other than personal use. You can learn from it but you can't copy it then paste it into notepad, make a few tweaks, and call it yours. I do not allow this. So do not. Click here to read the short terms of use and you will be able to use anything here within the rules stated there. |
|
|
|
Home Downloads Terms of use |
|
|
|
Source code for the Hex Calc: |
|
|
|
DECLARE SUB Help ()
DECLARE SUB InHex ()
DECLARE SUB inDec ()
DECLARE SUB Menu ()
CLS
PRINT "Licence: FREEWARE"
PRINT "Warranty: NONE"
PRINT "Author: THE Wizard Genius"
PRINT "Version: V1.0 - Be sure to go to 'www.qbspot.tk/newversion/' for version 2!"
PRINT "The Hex Calculator"
PRINT "For Computer Programmers Everywhere!"
PRINT "DISCLAIMER: NO WARRANTIES OR PRODUCT SUPPORT UNLESS IT'S ALREADY AT THE WEBSITE."
PRINT "Source: MUST BE INCLUDED IN ALL DOWNLOADS*"
PRINT "Executable: MUST BE INCLUDED IN ALL DOWNLOADS*"
PRINT "ZIPped version: MUST BE INCLUDED IN ALL DOWNLOADS*"
PRINT "*Note: SOURCE AND EXECUTABLE CAN BE SEPARATE, BUT LINKS TO THEM MUST"
PRINT "BE ON THE SAME PAGE RIGHT BESIDE EACH OTHER. DISTRIBUTION OF THIS PRODUCT"
PRINT "ON ANY WEBSITE OTHER THAN ONE OF MY OWN, OR OF A MEMBER OF HTC, MUST BE "
PRINT "ACCOMPANIED WITH THE DISCLAIMER AND A LINK TO MY WEBSITE. I MUST ALSO BE"
PRINT "CONTACTED BEFORE THIS IS DONE. FAILURE TO DO SO MAY RESULT IN... WELL, LET'S"
PRINT "LET'S JUST SAY THAT YOU'D BETTER OBEY THE RULES! HAPPY PROGRAMMING!"
SLEEP
COLOR 10, 9
CLS
Menu
SUB Help
CLS
PRINT "The interface is easy: Press 'H' at the main menu to convert Hex to Decimal,"
PRINT "'D' to convert Decimal to Hex, '?' to get Help, 'X' to exit..."
PRINT "The great thing is, this calc also displays the ASCII character for a Hex Value."
PRINT "in version 2 we plan to have an assembly instruction display too."
PRINT "In other words, we will display the assembly instructions which are associated"
PRINT "With the Hex values. So be sure to get version 2.0 (or 2.5) When they come out!"
PRINT "There will also be a Any-base to Any-base converter hopefully. If you can help,"
PRINT "Tell us how! We sure need help! So mail to qbspot@oocities.com and you'll have it!"
PRINT "You can also join High Text Computing by doing that. Press a key to continue..."
DO
c$ = INKEY$
LOOP UNTIL c$ <> ""
Menu
END SUB
SUB inDec
CLS
PRINT "Please enter a Decimal number:"
INPUT Dec1$
Hex1$ = HEX$(VAL(Dec1$))
IF VAL(Dec1$) >= 255 THEN
Dec1$ = "254"
PRINT "Value used: 254"
END IF
IF VAL(Dec1$) < 0 THEN
Dec1$ = "1"
PRINT "Value used: 1"
END IF
PRINT "Hex for "; Dec1$; ": "; Hex1$
PRINT "ASCII Character implied by value:"; CHR$(VAL(Dec1$))
PRINT "Press a key to continue..."
SLEEP
Menu
END SUB
SUB InHex
CLS
PRINT "Please Enter the Hex value:"
INPUT Hex2$
Hex2$ = "&h" + Hex2$
PRINT VAL(Hex2$)
IF VAL(Hex2$) >= 255 THEN
Hex2$ = "254"
PRINT "Value used: 254"
END IF
IF VAL(Hex2$) < 0 THEN
Hex2$ = "1"
PRINT "Value used: 1"
END IF
PRINT "Character implied:"; CHR$(VAL(Hex2$))
PRINT "Press a key to continue..."
SLEEP
Menu
END SUB
SUB Menu
CLS
PRINT "Welcome to the Hex Calculator!"
PRINT "Remember to go to 'www.qbspot.tk/newversion/' for version 2 of this program"
PRINT "when it comes out!"
PRINT "Please make a choice:"
PRINT "ex to decimal"
PRINT "ecimal to Hex"
PRINT "> Help!"
PRINT "Eit"
DO
a$ = INKEY$
b$ = UCASE$(a$)
LOOP UNTIL b$ = "H" OR b$ = "D" OR b$ = "X" OR b$ = "?"
PRINT a$
IF b$ = "X" THEN END
IF b$ = "H" THEN InHex
IF b$ = "D" THEN inDec
IF b$ = "?" THEN Help
PRINT "Register now for free at 'www.qbspot.tk/register' and reap the benefits of registration!"
END SUB
|
|