home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_1_1994.iso / 00146 / s / trial / article.txt < prev    next >
Text File  |  1993-10-01  |  9KB  |  139 lines

  1.  
  2.  
  3.  
  4.  
  5. Article appearing in March, 1993 issue of 
  6. Basic Code Cache (formerly QB News)
  7.  
  8.  
  9.  
  10.  
  11. Product Name:   PowerBASIC 3.0c
  12. Available from: PowerBASIC Inc.
  13.                 235 Oak St. - Suite 21
  14.                 Brentwood, CA  94513
  15.                 (510) 516-7700
  16. Price:        $149.00 + Shipping
  17. Available:    Immediately (shipping now).
  18.  
  19.  
  20.     PowerBASIC represents a clearly-defined and demonstrably better 
  21. alternative in the BASIC compiler market.  It concedes nothing to other 
  22. compilers, and extends the range of BASIC in ways that any other compiler 
  23. vendors might envy.
  24.     The envy ought to extend to the former leader, Microsoft.  That largest of 
  25. all software businesses started as a vendor of BASIC, and for years has prided 
  26. itself on having the best BASIC available.  For all those years, that pride 
  27. has been justified, but no more; the new king is a product called PowerBASIC.  
  28. To see why this is so, we need to ask just two questions: What do BASIC 
  29. programmers want?  What makes PowerBASIC so good?
  30.     The answer to both questions is the same: power.  Microsoft BASIC has five 
  31. numeric data types: integer, long integer, currency, and single and double 
  32. precision floating-point.  PowerBASIC adds single byte integer, unsigned word 
  33. and long integer, 8-byte (quad-word) integer, BCD fixed and BCD floating-point 
  34. (instead of just one currency type), and extended-precision real (80-bit 
  35. real).  While BASIC isn't made good or bad solely because of the number of 
  36. numeric data types supported, more types are a definite help -- and these 
  37. types have been on most BASIC programmers' wish lists for years.
  38.     Further, the BCD types in PowerBASIC are not limited to a single number of 
  39. decimal places; the programmer can specify (at run-time) how many places are 
  40. desired.  Rather than be limited to four decimal places for all calculations 
  41. (as with the currency data type), PowerBASIC allows you to set BCD to two 
  42. decimal places for exact (to the penny) calculations with no need for 
  43. rounding, or to any number of places from zero to eighteen for any particular 
  44. need.  The result is decreased overhead in each program (no need for 
  45. rounding), and increased flexibility.
  46.     PowerBASIC also implements BCD as scaled integers, rather than the 
  47. two-digits-per-byte "natural" method.  By using scaled integers, PowerBASIC's 
  48. approach gives increased speed -- ordinary BCD math has a deserved reputation 
  49. for sluggishness.
  50.      PowerBASIC also supports flex strings -- strings with a fixed length, 
  51. except that the length can be changed under program control -- and fundamental 
  52. changes in the way programs can be created.
  53.     Consider the usual way any program is created.  There are several steps; 
  54. design, code, test, debug, and retest.  In practice, the debug and retest 
  55. steps are repeated indefinitely.  No one seems to want to mention the reason 
  56. for the extended debugging and testing phases, perhaps because the reason is 
  57. so fundamental: the number of expressions and branches in the code.  In other 
  58. words, code complexity leads directly to coding errors.
  59.     From that standpoint, it is clear that the fewer expressions and the fewer 
  60. branches, the more likely a program will work correctly the first time, and 
  61. the easier it will be to enhance.  This is the big reason for the popularity 
  62. of toolkits, modular programming, and object orientation.  Sure, there are 
  63. other reasons for each of those things, but reduced complexity is the biggest 
  64. and certainly easy to defend.
  65.     So, how does this apply to PowerBASIC?  Simple: PowerBASIC adds functions 
  66. that would ordinarily be found in a toolkit or written as needed.  PowerBASIC 
  67. adds types to make it easier and more natural to express more programming 
  68. requirements in fewer statements, fewer lines, and fewer branches.  The more 
  69. power in the language, the better for the programmer -- and the person using 
  70. the applications.  Reliability helps everyone!
  71.     Some specific examples are in order.  Let's start with some of the array 
  72. commands and functions.
  73.     The Array Sort command allows the programmer to sort any type of array in 
  74. ascending or descending order, in whole or in part.  The sort can 
  75. simultaneously rearrange the elements in another array (a tag array).  It's 
  76. not so much that the sort command is useful; it's certainly that.  It's even 
  77. more important that it exists; it's such a generally useful command that it's 
  78. hard to imagine going without it once you've used it.  Even a low-level 
  79. language like C includes a sort command in its standard library.  No Microsoft 
  80. BASIC has a sort command, however.
  81.     Equivalently useful are commands like Array Scan (search any array for any 
  82. value), Array Insert (insert a new element in an array), and Array Delete.  
  83. Without PowerBASIC, the programmer either must write an equivalent for each, 
  84. or buy one.  It's not as if these commands are terribly complex, so there's 
  85. not a lot of work involved -- but there is some work, and it is repeated in 
  86. every program written, and those programs are thus larger and more likely to 
  87. contain errors, and slower than the PowerBASIC equivalent besides.
  88.     In every part of PowerBASIC, the same pattern is repeated.  Even mundane 
  89. matters like compiling are addressed; PowerBASIC supports conditional 
  90. compilation (making it easier to maintain separate versions of the same 
  91. program in one source module).  PowerBASIC also supports metacommands that 
  92. eliminates both long and complex command lines and lengthy and error-prone 
  93. selections from cascading dialog boxes.  To force the compiler to create a 
  94. program that will require an 80386 processor, you would insert the metacommand 
  95. $cpu 80386 at the start of the program, for example.  All executables can be 
  96. compiled to stand-alone files that need nothing more than MSDOS to run.  The 
  97. other metacommands are also named in easily-remembered ways, making Power 
  98. BASIC programs almost entirely self-documenting (at least potentially)!
  99.     Other notable advances include an in-line assembler with a full knowledge 
  100. of the environment (use MOV AX,X% to move the value of the BASIC variable X% 
  101. to the AX register), TSR creation, string memory (in any single array or any 
  102. number of arrays) up to the full amount of available memory -- not just 64K -- 
  103. and things like block memory moves, MAX and MIN functions, bit functions 
  104. (test, set, shift, and rotate), pointers, library support for arbitrary OBJ 
  105. files, and minor niceties almost everywhere you look.
  106.     Consider the INSTR function.  In any standard BASIC, INSTR returns the 
  107. first matching position of one string within another; INSTR("ABC","C") will 
  108. return the result 3.  PowerBASIC adds the ANY keyword for even more power, so 
  109. the function INSTR("GFDSALK",ANY "QWERTAS") will return the result 4 (S is 
  110. found before A).  The ANY keyword can also be used in commands like LTRIM, 
  111. RTRIM, REPLACE, and others.  Communications capability extends to 115K baud 
  112. and to other COM ports (to COM4, even all at once).  There is a MAP command 
  113. which allows you to subdivide a flex string into separate parts, similar to a 
  114. FIELD statement; in effect, you can define a type at run-time!  All this isn't 
  115. just "neat" -- it's good, solid, and genuinely useful stuff.
  116.     If you'd like to write TSR programs, PowerBASIC makes it easy; a complete 
  117. TSR can take as little as five lines, and you don't need a third-party library 
  118. -- the capability is built into PowerBASIC.
  119.     In sum, PowerBASIC was designed from the ground up with a very different 
  120. agenda than the other BASIC products.  PowerBASIC was written in response to 
  121. BASIC users; nearly every feature that appeared on very many wish lists was 
  122. included in PowerBASIC.  Some products have hidden agendas -- use them and 
  123. you're buying a vision of the future of programming or computing that may or 
  124. may not match what you'd like.  PowerBASIC is pragmatic; it's what you always 
  125. wanted in a computer language, and may be far more than you ever expected to 
  126. get.  That strikes me as especially significant.  After all, don't you want to 
  127. encourage a company that actually listens to its customers?
  128.     I do.  I'm now moving all my BASIC software from the former leader to the 
  129. new one, and that's not a step I take lightly.  After all, I've been using 
  130. products from the other vendor since 1976, and there's a lot to move.  It's 
  131. nice to discover that my EXE files are smaller and run faster, besides my 
  132. source files being an average of 25% smaller!
  133.  
  134.                     Bruce W. Tonkin
  135.                     President - T.N.T. Software
  136.                     34069 Hainesville Road
  137.                     Round Lake, IL  60073
  138.                     (708) 223-8595
  139.