PowerBASIC Gazette

Number 102 www.powerbasic.com


From: Bob Zale, President
           PowerBASIC, Inc.

PowerBASIC Gazette #102

Subject: What is Transparent Unicode?

PowerBASIC has coined the phrase "Transparent Unicode" to describe the implementation of this important character set in PB/WIN 10.0 and PB Console Compiler 6.0. PowerBASIC uses the popular UTF-16 format, where each character is represented by a 2-byte character code... a DWORD in the range of 0 to 65535. This is the so-called "standard" unicode format implemented by other programming languages as well.

In the past, the changeover to unicode was a bit rocky, at best. That's because other compiler vendors took an "all or nothing" approach. Make every string an ansi string, or make every string a unicode string. No middle ground, just use one or the other. Even worse, some offered no choice at all. Everything had to be unicode. No exceptions allowed. That was difficult. Very difficult. How many times have we all saved a numeric value in a string? That's the very reason MKI$() and CVI() were invented years ago. And how about user-defined types? Storing UDT data in a dynamic string is a perfect way to move it around easily. But with forced unicode, these techniques are simply useless. In fact, switching to unicode was a huge chore. Check out every string in every module. Make certain there was no data which could possibly be corrupted by unicode handling. No numerics. No UDT's. No special coding. And don't ever try to do it again.

PowerBASIC knew there had to be a better way. Keep all the advantages of ansi strings. Add all the benefits of unicode. All at once. In fact, all in the same program. Just offer two complete categories of strings: single-byte ansi strings, and two-byte unicode strings. How do we identify them? One option is the typical TypeID character. As always, single-byte ansi strings append the dollar-sign. The variable named by xyz$ is a dynamic ansi string. But what if you want unicode? Just append two dollar-signs, like the name abc$$. Of course, it may be better to declare your variables explicitly. In this case, the name of the string type includses a "w" to signify a wide unicode string.

LOCAL a AS STRING ' dynamic string - ansi
LOCAL b AS WSTRING ' dynamic string - wide unicode
LOCAL c AS STRING * 5 ' fixed length string - 5 ansi characters
LOCAL d AS WSTRING * 8 ' fixed length string - 8 unicode characters
LOCAL e AS STRINGZ * 5 ' nul-terminated string - 4 ansi chars + nul
LOCAL f AS WSTRINGZ * 8 ' nul-terminated string - 7 unicode chars + nul
LOCAL g AS FIELD ' field string - ansi field string
LOCAL h AS WFIELD ' field string - unicode field string

Yes, these names were specifically designed for symmetry. Prepend a "W" to signify unicode. Remove the "W" for single byte ansi. It's easy to use, easy to remember. But, for those who may have hundreds, even thousands of declarations using ASCIIZ, we haven't forgotten you! ASCIIZ will remain a synonym for STRINGZ for the forseeable future. It's just that the term WASCIIZ would have been an oxymoron, at best. How could we define an ascii string as wide unicode? Impossible.

So, what about Transparent Unicode? PowerBASIC handles all the messy details for you! How about assignment and concatenation?

a$$ = "Hello"
b$ = a$$
c$$ = b$ + a$$

It's all automatic. PowerBASIC handles everything, so that each of these code lines execute as expected. In the first line, "Hello" is automatically converted to unicode, and then assigned to a$$. In the second line, the contents of a$$ are converted to ansi, then assigned to b$. In the third line, PowerBASIC automatically converts b$ to Unicode format, appends a$$ to it, then stores the result in the variable c$$. It's just that simple. Everything works just as in the past, but your programs can now be unicode aware!

But is it fast? Of course! As always, PowerBASIC leads the way in performance. It's very special. Just try the execution of an INSTR() function against any other compiler on the planet. Unicode or ansi or both. As with every time sensitive function, PowerBASIC keeps two versions handy. One for OEM or ANSI, another for Unicode. Each of them is built with explicit, hand crafted machine code. When it's time to create your EXE, PowerBASIC includes only the one which best suits your code.

Unicode is important today. It will be pervasive soon. With the global growth of computer use, larger character sets are needed to represent the necessary characters. We have clearly reached the point where every programmer must consider alternate character sets for his applications. Failure to do so can carry severe penalties. When you find you can no longer read data files from an outside source, or can no longer read text from the Internet, it will be too late. Give it very close consideration today.

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 sign 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.

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.

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/

PowerTime Class

The PowerTime Object is pretty special. It's a complete Date & Time package for your applications. You can save and restore Date/Times. Perform Date/Time arithmetic. Print formatted displays of Date/Time. Calculate leap years, day-of-the-week, days-in-the-month and more.


What an opportunity to organize your program data. It's a lot like an array, but with no bounds to constrain. Add items, remove them, search for them by a "key" string, and more. Use them for random access to the data, a linked list, a stack, a even a queue.

Ready now? GOTO www.powerbasic.com -- BUY NOW!

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 -- 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 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) 2012 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 102
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 forward this newsletter, with "unsubscribe" in the message to support@powerbasic.com with your name and zip/postal code.