Octal, Hex, Binary

by qbguy (no login)

In QBASIC, we have

&O (ampersand, letter o) for octal (a plain ampersand also works)
&H (ampersand, letter h) for hexadecimal
The LEN function for unary [LEN("*****") = 5]

It would make sense to add &B for binary (as well as the function BIN$) to QB64.


Other random ideas for random base support:

Add an optional paramater to val and str:

VAL("11110", -2) = 10

And then we could add complex numbers, allowing base -2i:

STR$(CMPLX(7, 6)) = 7+6i
STR$(CMPLX(7, 6), CMPLX(0, -2)) = 10333

Posted on Jun 25, 2008, 9:03 AM
from IP address 75.0.227.216

Respond to this message   

Return to Index


Response TitleAuthor and Date
Slow down there big boy. What happened to Qbasic here? on Jun 25
 qbasic already has octalmennonite on Jun 25
 i'm glad you're trying to keep the "fun" in function codingmennonite on Jun 25
  Philosophy..............right up your alley Mr. ASCII on Jun 25
   okay...mennonite on Jun 25
    Those features came with the C programming on Jun 25
     i try to be super human in replying... actually i don'tmennonite on Jun 25
      *It's a bird. It's a plane! Naw it's just Mennonite......... on Jun 25
       oh i like thatmennonite on Jun 25