PowerBASIC Gazette

Number 99 www.powerbasic.com


Subject: Radix Number Display

Dear PowerCoder,

Radix number formats are an important option for every programmer. Our latest compilers, PB/CC 6.0 and PB/WIN 10.0, offer some nice features to simplify your coding life. But more about that in just a moment.

First, I'd like to thank Chris Boss, the author of EZ-GUI, for his nice article about PowerBASIC. It's published on the Tech Republic web site at:

Read article here

The Tech Republic is a valuable site to the industry which gets around 500,000 hits daily from pros like you. I hope you'll take a quick look, and consider leaving a comment to the article about PowerBASIC. You can sign up on the spot, and a remark would sure help "spread the word"! PowerBASIC may be one of the software industry's best kept secrets. A few words from you can help us change that.

So, let's get back to Radix Numbers. Radix format numbers are used to represent a value in a variety of bases, the most common being 10, 16, 2, and 8. Decimal, hex, binary, and octal. The value 10 (decimal) can be represented as 0A (hex), 1010 (binary), or 073 (octal). All four of these represent the identical value. Only the format of the display is altered to fit the context in which it is used.

The new compilers offer some important new options for radix conversion. They include DEC$(), HEX$(), BIN$(), and OCT$(). All four of them are used to convert a numeric value into a string containing the appropriate representation. They now offer some important options. For example:

s$ = HEX$(IntVal [, Digits, LeadSpaces, TrailSpaces])

The last three parameters are optional, but I think you'll find them to be pretty useful. IntVal is a numeric expression within the range of a 64-bit Quad Integer (-9223372036854775808 to +9223372036854775807). Any fractional part is rounded.

Digits tells how many digits should be displayed. If 0, no leading characters are ever added. If positive, leading zeros are prepended to achieve the desired length. If negative, leading spaces are prepended instead. LeadSpaces and TrailSpaces add blanks for good formatting. In the past, if you wanted to display 4 hex values in columns, you'd do something like this:

s$ = " " + RIGHT$("000" + HEX$(10), 4) + _
" " + RIGHT$("000" + HEX$(20), 4) + _
" " + RIGHT$("000" + HEX$(30), 4) + _
" " + RIGHT$("000" + HEX$(40), 4)

The result in s$ would be " 000A 0014 001E 0028". It works, but with lots of typing and lots of calculation at run-time. Using the new PowerBASIC, you accomplish the identical result with:

s$ = HEX$(10,4,2) + HEX$(20,4,2) + HEX$(30,4,2) + HEX$(40,4,2)

An improvement? Absolutely. So, how about conversions in the other direction? That's pretty straightforward, too. Of course, a decimal number is simply written with digits. For hex numbers, you would prepend &H, for binary you'll use &B, and for octal, it's &O or &&Q.

10 = &HA = &B1010 = &Q73

All four methods produce the identical value. Sounds easy? Yes, of course it does. And it is easy. But there is one very important consideration that you must keep in mind. Signed vs Unsigned. If you forget, it can cause insidious bugs in your code. Just remember that radix formats default to signed numbers. For example, does &HFFFF evaluate to 65535 or -1? Because of the signed number default, the correct answer is -1. So, how do you represent 65535 in hex? There are two ways available...

1- Add a leading zero: &H0FFFF = 65535
2- Add any unsigned typ ID: &HFFFF? = &HFFFF?? = &HFFFF???

The number of question marks really makes no difference in this case. Any of them signifies you wish to evaluate as an unsigned number.

Books... Books... Books...

We now have books. PB/Windows 10 books. PB Console 6 books. We can ship them to you today. Just in case you're interested in an official PowerBASIC souvenir, we'll even autograph your book with a personal message. Just add a comment to your order...

These books are really huge. The PowerBASIC 10 for Windows Manual offers more than 700 pages, and the PowerBASIC Console Compiler Manual isn't far behind. They're packed with the information you need about PowerBASIC. They're well made, with nice glossy covers to keep them looking fresh.

Not sure of the difference between COM and COMM? AUTOMATION and DISPATCH? LET and SET? ANSI vs. ASCII vs. Unicode? Or maybe you want to optimize with some inline assembler? Here's your chance to learn without being tied to your PC. Books go anywhere!

Let's face it, online documentation can be handy... it gives us instant context help, and we can lean back while it searches for us. But there are always times when we'd just prefer to sit and read a printed book. Books don't occupy screen space, so they don't cover up your code and data in the IDE. Books are available on a plane, train, or armchair. Regardless, I'm sure you'll find these books attractive and useful.

There are two new books available, one for PowerBASIC 10 for Windows, the other for PowerBASIC Console Compiler 6. They're priced at just $49, and they're available today.

You know, a number of customers have asked for signed copies of our books for a whole variety of reasons. So we decided to make it available, as an option, just in case you'd like it, too! But don't fear, we won't mark your books unless you specifically ask! {smile} It's an option! But it will only be offered for a short time, so if you'd like one, the time to act is right now. To order one or more signed books, just make a note "Please sign the book" in the comments section of the order form. It's located at the bottom of the page with your name, address, etc. If there's a special request or a special message you'd like, just tell us about it, too. We'll do our best to help.

On the same subject, keep in mind we still have DOS books available, too. They're geared towards PowerBASIC 3.5 for DOS. These are offered as a 2-volume set, both User's Guide and Reference Guide, and priced at just $29 for the set.

THE POWER Changes Everything

Just in case you're one of the few... who hasn't yet upgraded to the latest compilers -- Stay with me for a minute?

Now is the time to move. Full product purchases are just $199 and $169. Pretty refreshing compared to some of the $2,000-$5,000 prices from the competition! If you qualify for an upgrade, you can still take advantage of special pricing. Upgrade PB/WIN 9 to PowerBASIC 10.0 for just $99 -- upgrade PB/CC 5 to PB/CC 6.0 for just $89! There is no reason to wait... today is the day to upgrade.

Of course, PB/CC is our Console Compiler -- creates programs with a text mode user interface. Easy to use. Easy to port from DOS. It's the perfect solution for CGI Internet applications. Any time you want pure performance and nothing more! PowerBASIC 10 for Windows gives you the "look and feel" of a graphical user interface (GUI), the essence of Windows. Frankly, they've both taken a big leap forward.

Transparent Unicode

You know, a good compiler offers you ANSI strings. This has been the standard for many years. A better compiler lets you choose between ANSI and UNICODE in each program. But only one of them per program. If you want Unicode, you can't keep binary bytes in a string. It simply won't work. If you want ANSI, you can't have Unicode without exhaustive conversions. Not so good.

A great compiler, like PowerBASIC, supports all of them in the same program. And it's totally transparent. With PowerBASIC 10.0 for Windows (or PowerBASIC Console Compiler 6.0), you can have it all. One variable with ANSI. Another with UNICODE. Mix and match any way you choose with PowerStrings. All the messy details, and even the needed translations, are handled automatically by the compiler.

You can finally display a Euro symbol. Unicode text in a GUI or a Console. Read and write a Unicode file. Even print Unicode text on a Windows printer!

Static Link Libraries

Compile all your general purpose code into static units. Then, when it's needed, just $LINK it into your EXE or DLL and you're on your way. It's pre-compiled, so it's perfect for team programming. What will it do for third-party tools? Plenty. PerfectSync has already released SQL Tools 3. It links right into your EXE, so there's no need to drag a DLL around. Just $LINK and go. Lots more tools are sure to follow. And, if that's not enough, you'll get a librarian, too. Combine any number of units to a single library, and just use one single $LINK. PowerBASIC just discards those which aren't necessary. SLL's can contain Subs, Functions, and Object Classes. How easy can it get?

Automatic Dead Code Removal

Fight the war on BloatWare. Now, you can include big libraries of useful code -- PowerBASIC cleans it up for you. Any Sub/Function not used is automatically ignored when compiled. In fact, even Classes are pared down by similar Method and Property removal.

Order Now? GOTO https://shop.powerbasic.com/

There's more. Lots, lots more. A completely new IDE based on Tabs, with syntax display as you type! Transparent Unicode. Print Preview. Thread Objects. A built in Resource Compiler. A StringBuilder Class. PowerArray class encapsulates SafeArray structures. A DEC$ function formats decimal numbers. Graphic Windows with scroll bars and scroll keys, user drag to resize, clip areas, and wrap by whole word. ENUM blocks, PREFIX blocks, ASMDATA blocks. THREADSAFE option for functions and methods. TEXT windows, Text Split, and the new FASTPROC procedures. There's more, but it's easy to see this is a very important upgrade.

SQL Tools version 3

You can use the power of SQL to access relational databases from Microsoft Access, SQL Server, Oracle, FoxPro, dBase, Btrieve, and 50 other popular formats. Open a database with a single line of code, and use standard SQL statements to build powerful, sophisticated, multi-user database programs! This is a total database solution.

This product has earned accolades from virtually all of its users. Version 3 is certainly no exception. With both a DLL and an SLL, you'll have the option to just $LINK units and libraries right into your EXE. No more DLL's to drag around, unless you choose it. Even better, PowerBASIC will only link the code that's necessary. Version 3 is faster and leaner, even with all the new features.

Many functions have been simplified. You can retrieve all rows in a single operation. You'll also get improved trace files, Quad integers, Unicode, plus enhanced Memo and BLOB field support. Then there's improved Microsoft Access database support, and much more! Documentation is provided in CHM, HLP, and PDF formats.

You can order right now...

PB/WIN 10.0 is priced at $199, while PB Console Compiler is $169. Upgrades from versions 9 and 5 are just $99 and $89 respectively. SQL Tools Pro is $199.95, while SQL Tools Std is $99.95. Upgrades from version 2 are $99.95 and $69.95 respectively.

Need more info?

We have a page created just for you. It's "Why should I upgrade?"

GOTO http://www.powerbasic.com/products/whyupcc.asp
GOTO http://www.powerbasic.com/products/whyupwin10.asp

Need even more info?

The comlete documentation for both PB/CC 6 and PB/WIN 10 can be found right on the PowerBASIC Web Site! To see the 100% complete documentation:

GOTO www.powerbasic.com -- {Click} HELP DESK

You'll find everything you need to know to make an informed decision. You can order right now by replying to this email. You can call us today at (888)659-8000 or (941)473-7300, or fax us at (941)681-3100.

You can visit https://shop.powerbasic.com/ to place an e/order on our secure web site, or even mail an order to our offices. But no matter what method you choose, do it today and do it with confidence. Every product PowerBASIC ships for physical delivery is offered with a money-back guarantee for a full 30 days from the transaction date.


Bob Zale, President
PowerBASIC Inc.

PowerBASIC Price List

PB/CC Console Compiler 6.0 - Full Product $169.00
PB/CC Console Compiler 6.0 - Upgrade from ver 5 $89.00
PB/CC Console Compiler 6.0 - Upgrade from prior versions $119.00
   Add Printed Documentation $49.00
PowerBASIC for Windows 10.0 (GUI) - Full Product $199.00
PowerBASIC for Windows 10.0 - Upgrade from ver 9 $99.00
PowerBASIC for Windows 10.0 - Upgrade from prior versions    $129.00
   Add Printed Documentation $49.00
PowerBASIC for DOS 3.5 - Full Product $99.00
PowerBASIC for DOS 3.5 - Upgrade from prior versions $49.00
   Add Printed Documentation (2 book set) $29.00
PowerTree BTree Manager for DOS and Windows $99.00
PowerBASIC Forms Visual Designer ver 2.0 $99.00
SQL Tools Standard Version 3.0: $ 99.95
   Upgrade from ver 2 (Std) $69.95
SQL Tools Professional Version 3.0: $199.95
   Upgrade from ver 2 (Pro) $99.95
   Upgrade from ver 2 (Std) $129.95
Graphics Tools Standard ver 2 for PB/CC & PB/WIN $69.95
Graphics Tools Professional ver 2 for PB/CC & PB/WIN $139.95
Graphics Tools Standard ver 2 Upgrade from ver 1 $44.95
Graphics Tools Professional ver 2 Upgrade from ver 1 $114.95
Graphics Tools Professional ver 2 Upgrade from ver 2 Std $79.95
Console Tools Standard: $49.95
Console Tools Professional: $99.95

Shipping/Handling costs:

Any SoftwareSoftware
& 1 book
Addl Book
UPS Ground/Mail US$10$10$ 8
Express 2-day US$18$18$14
Express 1-day US$28$35$30
Air Mail Canada/Mex    $10$18$18
Express Canada/Mex$30$40$34
Air Mail Intl$14$28$28
Express Intl$36$46$40

Order online at https://shop.powerbasic.com/ or just send an email with all pertinent information to:

We'll take it from there!

Most PowerBASIC products (those without printed books) can now be delivered by electronic mail. No wait for a package to arrive... No high shipping costs... For just $6 per order, no matter how many products, we'll deliver directly to your computer. If you're outside the U.S., savings might be greater. You won't pay taxes or duties to a freight company or postal service, because they aren't involved in the delivery. Check your tax code to be sure, but some countries charge no tax at all on transactions of this type. It could just be your lucky day!

Send your subscription request to email@powerbasic.com and please include your name and all email addresses you'd like to add as well as your Zip or Postal Code.

If you know someone else who would enjoy this newsletter please forward a copy to them so they can subscribe.

All contents Copyright (c) 2011 PowerBASIC Inc All Rights Reserved. PowerBASIC, PB/CC, PowerBASIC Forms, and PowerTREE are trademarks of PowerBASIC Inc. Other names are trademarks or registered trademarks of their respective owners.

PowerBASIC Gazette - Electronic Edition
Volume 1 - Issue 99
PowerBASIC, Inc. (888) 659-8000 Sales
2061 Englewood Road (941) 473-7300 Voice
Englewood, FL 34223     (941) 681-3100 Fax

Visit us on the Net at www.powerbasic.com
Email Sales at sales@powerbasic.com

This newsletter is only sent to email addresses in our subscription list. If you have received this newsletter by mistake or no longer wish to receive it, please send a simple unsubscribe request to support@powerbasic.com with your name and zip/postal code.