No announcement yet.

PB pontential purchaser questions

  • Filter
  • Time
  • Show
Clear All
new posts

  • #41

    Had a look at that ppstour demo on the linked site, and thats close to what I'm hoping to achieve. At least now I have seen a working application...
    For the size of it (only one file, and under half a meg) that's pretty much convinced me that PB is the way to go. One local guy here made a "hello world" type program in VBx2008 that, with runtimes and the installer, was nearly half a GIG! I new that "modern" compilers made bloat, but I didn't expect that much of a difference.

    Any chance of posting the source (or even partial source) so I can see how complex an app like that demo is?



    • #42
      Chris H (and others)

      I can kind of follow that code - am I right in assuming that it draws 10 pictures that individually change randomly at set intervals, and change immediately when the image is clicked on?

      I've saved your (and others) code, and I'll study it and compare it with the online documentation over the next few days.



      • #43
        Originally posted by Steve Rossell View Post

        Maybe the easiest method would be to use BitBlt to draw the bitmap directly onto the dialogs DC (GetDC). This can be done in five or six lines of code.
        Hi Steve,
        Not sure what you mean by BitBlt - the online manual says "no topic found". Same result for Getdc.

        Not sure if you have been following this thread from the start - my programming background is microcontrollers, not PC / Windows.
        We are looking at PBWin for making unrelated PC apps, after looking at existing software which is too complex/buggy/bloated for what we want to achieve.
        It's a little harder than normal because there is no "demo" version of PB, so far we've got some examples of source code and one executable, but none together...

        Any chance of posting the "five or six lines of code" please?

        Thanks for the reply,


        • #44
          1) Finally purchase

          2) Have you even looked at the stuff i posted, it's fairly complete ans small..
          Just a few slight modifications

          3) No one can help you if don't have a compiler at some point.


          • #45
            Originally posted by Chris Burgess View Post
            am I right in assuming that it draws ...

            Where can we send funds to help you buy the compiler?


            • #46
              Any chance of posting the source (or even partial source) so I can see how complex an app like that demo is?
              Posting, no. Licensing, maybe.

              But I told you in the linked thread how I did everything, which was mostly by appropriating code written by others, code I got here!
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]


              • #47
                For those that have been unfortunate enough to live in this day and age without the abilities of Power Basic should look at "Built with Power Basic" on PB's homepage.

                It shows a good range of programming accomplishments and should alleviate any worries about PB's capabilities. It's the programmer's range capabilities that are most likely the limiting factor.

                In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.


                • #48
                  I would use Edwin's source as it is the same as I was thinking, he is using StretchBlt and I said to use BitBlt. StretchBlt will work with any size image and dialog and BitBlt will only work with a fixed image and dialog size. When you purchases the compiler, you will receive a help file that describes the API calls such as StretchBlt and BitBlt.

                  Steve Rossell
                  PowerBASIC Staff


                  • #49
                    I can see why/where/what Chris Burgess is wary about a product that can not be tried out. But on the other hand, Chris, take the leap, you will NOT regret it.

                    Even though some offered a collection (although a bit facetiously ) it should go to show that not only do we use it, but we SUPPORT it whole-heartedly.

                    after all...if you look around the forums, and other forums, how often do you see "Owners of the company / Programmers themselves that use the product" that also peruse the forums, and offer help?????? I bet nearly none except here. (sorry Bob if I overstepped my bounds there)

                    Just the support alone is worth the price of the product....(hmmm doesn't the price of the product somewhat represent the size of the product? aka: other languages charge Thousands of dollars for each and every version and yet PB is only a couple hundred or less for all the add-ons or tools you will ever need. (and from experience often FREE upgrades from version to version) not to mention COMPILE-ABLE between versions rather than force you to spend another couple grand just to view code written in a newer version (I will leave other so called languages out of this (Ahem...NI...Ahem)

                    In fact Chris....if you do not like the product, I will personally buy it back from you. (Assuming PB will let me register it under my name, no harm no foul)
                    Engineer's Motto: If it aint broke take it apart and fix it

                    "If at 1st you don't succeed... call it version 1.0"

                    "Half of Programming is coding"....."The other 90% is DEBUGGING"

                    "Document my code????" .... "WHYYY??? do you think they call it CODE? "


                    • #50
                      PB/CC makes EXE files, with or without a console screen. It is best suited to procedural programming, similar to QBasic, and is the obvious growth product from old DOS programmers. It can use DLLs created by other development tools.

                      PB/Win makes either DLL or EXE files. A console screen is also possible, but you have rely on the Windows API to create and manage it. Normally you are using Windows dialogues to receive input and post results. It also can use DLLs from other sources. In general, PB/Win programs are event driven in the manner of VB, rather than procedural oriented as with PB/CC and QBasic.

                      Both products are about 95% compatible with each other, in syntax and capabilities. Thus, with a bit of added effort, you can write programs that can work with either. But generally the interest is to write to just one compiler's syntax and maximize its potential.

                      PowerBasic includes inline assembler capabilities which is advantageous for maximizing performance or adapting code to specific needs. It lets you under the hood where windows is concerned, so you can tweak many aspects of your experience. You want fixed size screens, different fonts, custom colors, animation, sound, even Aero effects like you find with Vista? Somebody has found a way to do this already. Many third party tools exist, each intended to make the developers job ever easier, and most were themselves written in PowerBasic. It's that good.

                      Looking around the PowerBasic forums, and searching for matches elsewhere on the Internet, you will discover a lot of interest, examples, sample code, and answers to questions you have not even thought of yet. Everything you asked for is within its scope. Yes, the manual makes for good reading, and can cover topics in a more orderly fashion, but the help files are adequate for learning much of the capabilities and syntax involved. And when you start a new phase of your project, a search of the forums will turn up literally scores of reference code examples to get you started. And if you are ever stumped about what to do next, just post a question and get input from others.

                      Everything is strickly class A about PowerBasic, and if you run into something you aren't too happy about, you can send them an email, and they will review and respond. I just had a problem with REGEXPR, where I was trying to use this mask similar to this, and it would not work properly: ",| [^a-z0-9]", this probably means squat to you, but a Linux programmer would likely recognize something similar to this being used with awk. It defines a filter for processing a string, My problem was that it was not correctly catching a comma. Within a matter of hours I got a reply to use this instead: "(,)|( [^a-z0-9])", and an explanation why my code did not work from a PowerBasic staff member. It's sort of hard to top that, right?


                      • #51
                        Originally posted by Cliff Nichols View Post
                        I can see why/where/what Chris Burgess is wary about a product that can not be tried out. But on the other hand, Chris, take the leap, you will NOT regret it.
                        One thing I always mention (talking about PB/WIN): Even if you're *not* going to choose PB as your main development tool, congratulations, you just purchased a reasonable priced 3rd party add on for VB. Compare it's capabilities and its price against other 3rd party products and you'll find its a bargain.

                        And who knows ... some day PB will become your main tool.


                        • #52
                          Even if you're *not* going to choose PB as your main development tool, congratulations, you just purchased a reasonable priced 3rd party add on for VB. Compare it's capabilities and its price against other 3rd party products and you'll find its a bargain
                          I know I started out that way, when my boss bought a copy for me to play with, and I was starting to realize there were things I could not do with MsComm, but PbComms I could do.

                          Then I started realizing how easily I could build DLL's to support some of my larger projects in VB, then the next thing you know....I forgot VB existed
                          (No more dependencies, no more bloat (unless I purposely put it in), and best of all a heck of a lot faster)
                          Engineer's Motto: If it aint broke take it apart and fix it

                          "If at 1st you don't succeed... call it version 1.0"

                          "Half of Programming is coding"....."The other 90% is DEBUGGING"

                          "Document my code????" .... "WHYYY??? do you think they call it CODE? "


                          • #53
                            Hello Chris,

                            I’ve been away and just found this thread. Several thought hit me.

                            Firstly, I think you should read up on what the API’s do and how they relate to Windows. Windows was designed so that all program output is handled by Windows, primarily through the GDI. When PowerBASIC sends, say, a command to display a bitmap on the screen the command is given to the relevant API to perform. There are PowerBASIC commands which do the same thing. These are wrappers for the API, there to simplify programming. BitBlt() and GetDc() are two API’s.

                            Secondly, Windows functions on a messaging system where your application is advised of every action – like mouse movement, keyboard use or even another application starting. A program running under Windows must advise Windows of the function where messages will be sent. This is the basic interface between Windows and your program.

                            I did a quick google and found:


                            which looks like it explains Window’s messages (did not read the article). I can also scan a page from a Window’s programming bible that covers the topic well, if you wish (email me directly).

                            Thirdly, Donald Darden makes a good point about the difference between a Windows and Console program. It’d be worthwhile ensuring you understanding the difference.

                            Finally, PowerBASIC allows a programmer to program without direct reference to the API (or SDK). It takes care of all of Window’s requirements behind the scenes – you program as you would using QBasic. PowerBASIC also allow you to program directly with the API (using the SDK). Here you call a range of Windows functions directly. Either style can get the job done and there are pro’s and con’s for both.

                            I see you’ve been shown several code samples . The only issue here is that some have been written using the API’s, others haven’t, some use both.

                            Hope this helps.


                            PS: I’ve only recently come across to PowerBASIC myself and as part of my learning I converted many of my old programs to PowerBASIC. One of these was OwnerDraw.bas, which I developed to work out how to display bitmaps in button instead of using Windows native approach. It’s available for download in the Download section.


                            • #54
                              Here's the compile log fo the tour application (compiled 12/3/07).
                              PowerBASIC Compiler for Windows
                              PB/Win  Version 7.02 
                              Copyright (c) 1996-2003 PowerBasic Inc.
                              Carmel, California, USA
                              All Rights Reserved
                              Primary source:  D:\SOFTWA~1\Products\ppps\demo\pppsdemov3.bas   {34400 total lines}
                              Target compilation:  pppstour.exe
                              Compile time:  0.7 seconds, at 2948571 lines/minute
                              25600 bytes compiled code, 26350 bytes RTLibrary,
                              1380 bytes string literals, and 3744 bytes dgroup.
                              Executable stack size:  1048576 bytes.
                              Disk image: 463360 bytes   Memory image: 31474 bytes.
                              Note that of the 34,000 lines total, the actual "program" file (pppsdemov3.bas) is only 1674 lines... and that's with
                              my comments included (and I comment A LOT). The rest is #INCLUDE files:
                              Files supplied with the compiler: 
                              #INCLUDE "WIN32API.INC"    ' DATE: May 9 2002    ' 24,358 lines
                              #INCLUDE ""                               982 lines
                              ' #INCLUDE files from my library:
                              #INCLUDE "STDOUT_PBWIN.INC"            about 100 lines
                              #INCLUDE ""                    681 lines
                              ' file from Tony Burcham I downloaded from here. 
                              #INCLUDE ""          418 lines
                              No, I've never been able to foot the compiler's line and statement counts to physical file sizes.

                              Plus some of the #INCLUDE files themself #INCLUDE other files, but Ultra-Edit has no way to easily find them for me.

                              PB Codec does, however... let me run that against the main source and see what I get...
                               PBcodec report: PPPSDEMOV3.BAS + include files. Generated 04-26-2008, 09:25:44
                               4296 lines scanned in 0.077 seconds (3336699 lines/minute)
                               MAIN + INCLUDE FILES
                               D:\Software_Development\Products\ppps\demo\pppsdemov3.bas [Main source file]
                               D:\Software_Development\Products\ppps\demo\SHOWPIC.INC    [pppsdemov3.bas]
                               UN-USED FUNCTIONS  (exported, or in incl. files, may be used by other programs)
                               FUNCTION ResourcesbyType                             [pppsdemov3.bas] : 974
                               FUNCTION LoadFile                                    [pppsdemov3.bas] : 1155
                               UN-USED SUBS  (exported, or in incl. files, may be used by other programs)
                               DECLARED, BUT NON-EXISTING SUB/FUNCTION(S)
                               FUNCTION PT_UnCompress                               [pppsdemov3.bas] : 167
                               FUNCTION DllVer                                      [pppsdemov3.bas] : 204
                               FUNCTION PT_UnCompress                               [pppsdemov3.bas] : 1106
                               FUNCTION RelCall                                     [SHOWPIC.INC] : 79
                               FUNCTION RendCall                                    [SHOWPIC.INC] : 81
                               FUNCTION RendCall2                                   [SHOWPIC.INC] : 85
                               FUNCTION RendCall3                                   [SHOWPIC.INC] : 94
                               FUNCTION DimenCall                                   [SHOWPIC.INC] : 103
                               FUNCTION GetCurDC                                    [SHOWPIC.INC] : 104
                               FUNCTION GetIPic                                     [SHOWPIC.INC] : 105
                               EXISTING, BUT NON-DECLARED SUB/FUNCTION(S)
                                 1 FUNCTION IsScClose                              [pppsdemov3.bas] : 100
                                 3 FUNCTION SetToolTip                             [pppsdemov3.bas] : 206
                                 1 FUNCTION EnableCursorKeys                       [pppsdemov3.bas] : 353
                                 1 FUNCTION WndProc                                [pppsdemov3.bas] : 377
                                 1 FUNCTION AddMainChildControls                   [pppsdemov3.bas] : 735
                                 0 FUNCTION ResourcesbyType                        [pppsdemov3.bas] : 974
                                 1 FUNCTION EnumResourceNames_CountProc            [pppsdemov3.bas] : 1005
                                 1 FUNCTION EnumResourceNames_FillProc             [pppsdemov3.bas] : 1011
                                 1 FUNCTION ExtractZlibDll                         [pppsdemov3.bas] : 1058
                                 1 FUNCTION GetSlideOrderTable                     [pppsdemov3.bas] : 1223
                                 1 FUNCTION StreamRichEditText                     [pppsdemov3.bas] : 1529
                                 1 FUNCTION StreamRichText_CallBack                [pppsdemov3.bas] : 1574
                                 2 FUNCTION SetButtonSubClass                      [pppsdemov3.bas] : 1627
                                 1 FUNCTION ButtonSubClassProc                     [pppsdemov3.bas] : 1659
                                 1 FUNCTION CheckVideoResolution                   [pppsdemov3.bas] : 1697
                               UN-USED GLOBAL VARIABLES
                               g_sPicFileName                                     [SHOWPIC.INC] : 65
                               UN-USED LOCAL VARIABLES
                               szResType                                          [pppsdemov3.bas] : 385
                               szResName                                          [pppsdemov3.bas] : 385
                               I                                                  [pppsdemov3.bas] : 391
                               hCtrlTop                                           [pppsdemov3.bas] : 393
                               hctrlNotTop                                        [pppsdemov3.bas] : 393
                               xScale                                             [pppsdemov3.bas] : 742
                               yScale                                             [pppsdemov3.bas] : 742
                               hRez                                               [pppsdemov3.bas] : 744
                               vRez                                               [pppsdemov3.bas] : 744
                               hDC                                                [pppsdemov3.bas] : 744
                               Z                                                  [pppsdemov3.bas] : 977
                               sRawData                                           [pppsdemov3.bas] : 1192
                               sDecompData                                        [pppsdemov3.bas] : 1192
                               sRawData                                           [pppsdemov3.bas] : 1209
                               sDecompData                                        [pppsdemov3.bas] : 1209
                               pMem                                               [pppsdemov3.bas] : 1255
                               fEventMask                                         [pppsdemov3.bas] : 1534
                               E                                                  [pppsdemov3.bas] : 1539
                               pDW                                                [pppsdemov3.bas] : 1577
                               TOTAL REFERENCE COUNT - (Count, Name, [declared in File] : at Line number)
                               Lists how many times the following has been called/used (zero = un-used)
                                 1  IsScClose                                      [pppsdemov3.bas] : 100
                                 3  SetToolTip                                     [pppsdemov3.bas] : 206
                                 1  EnableCursorKeys                               [pppsdemov3.bas] : 353
                                 1  WndProc                                        [pppsdemov3.bas] : 377
                                 1  AddMainChildControls                           [pppsdemov3.bas] : 735
                                 0  ResourcesbyType                                [pppsdemov3.bas] : 974
                                 1  EnumResourceNames_CountProc                    [pppsdemov3.bas] : 1005
                                 1  EnumResourceNames_FillProc                     [pppsdemov3.bas] : 1011
                                 1  GetTempWorkFileName                            [pppsdemov3.bas] : 1032
                                 1  ExtractZlibDll                                 [pppsdemov3.bas] : 1058
                                 1  Uncompress                                     [pppsdemov3.bas] : 1113
                                 1  gzDecompressString                             [pppsdemov3.bas] : 1127
                                 0  LoadFile                                       [pppsdemov3.bas] : 1155
                                 1  GetPictureData                                 [pppsdemov3.bas] : 1166
                                 1  GetCommentText                                 [pppsdemov3.bas] : 1188
                                 1  GetRichEditSlideText                           [pppsdemov3.bas] : 1205
                                 1  GetSlideOrderTable                             [pppsdemov3.bas] : 1223
                                 1  RenderPicture                                  [pppsdemov3.bas] : 1252
                                 1  StorePicData                                   [pppsdemov3.bas] : 1415
                                 1  GetCommentFont                                 [pppsdemov3.bas] : 1441
                                 1  StreamRichEditText                             [pppsdemov3.bas] : 1529
                                 1  StreamRichText_CallBack                        [pppsdemov3.bas] : 1574
                                 1  GethLibRichEdit                                [pppsdemov3.bas] : 1596
                                 2  SetButtonSubClass                              [pppsdemov3.bas] : 1627
                                 1  ButtonSubClassProc                             [pppsdemov3.bas] : 1659
                                 1  CheckVideoResolution                           [pppsdemov3.bas] : 1697
                                 3  LoadPic                                        [SHOWPIC.INC] : 138
                                -1  LoadPic                                        [SHOWPIC.INC] : 266
                               GLOBAL VARIABLES:
                                 4  g_hZlib                                        [pppsdemov3.bas] : 126
                                 2  g_dwProcZlibUncompress                         [pppsdemov3.bas] : 126
                                 1  g_hWnd                                         [SHOWPIC.INC] : 62
                                 7  g_hDC                                          [SHOWPIC.INC] : 63
                                10  g_rct                                          [SHOWPIC.INC] : 64
                                 0  g_sPicFileName                                 [SHOWPIC.INC] : 65
                              Well,I know PBCodec skips certain files, eg Win32API.INC.

                              But as you can see, PBCodec only scanned 4296 lines, which I guess is approximately how many lines of "non-PB-supplied Windows' header file code" was required to create the application.

                              Michael Mattias
                              Tal Systems (retired)
                              Port Washington WI USA
                              [email protected]