Announcement

Collapse
No announcement yet.

Transition from Dos to Windows programming

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transition from Dos to Windows programming

    Hi,

    Am trying to make the transition from DOS programming
    (where I am proficient - ie PDS aka QB7) to a Windows
    environment.

    Have struggled with VB6, but just can't seem to get over
    the hump. Am having difficulty getting over the nonlinear
    structure the Windows environment.

    Would PB for Windows be any easier for me, do you think?
    And are there any decent books to get started with?

    I have scanned the fortum here and can see where it would
    be a BIG help and is (almost) enough to convince me to make
    the change to PB Windows.

    TIA,

    Swede

    ------------------
    Gösta H. Lovgren
    http://www.SwedesDock.com
    http://www.PondersBible.com

  • #2
    You would find PB/CC very easy to understand, as it uses a very similar design to the traditional DOS BASICs. However, in a large part, that is because PB/CC is for writing "console" programs, which use what look like DOS windows. If you want full Windows GUI support, you'd want the PB/DLL compiler, which would take a little more getting used to.

    For recommended books, check the Frequently Asked Questions forum.

    For a better idea of how PowerBASIC code works, why not download the sample programs? You can find the complete sets of PB/CC and PB/DLL sample programs, and lots more, in the Downloads area here:
    http://www.powerbasic.com/files/pub/pbwin/


    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      There is no other compiler available -- anywhere--
      that will let you access Win32API as easily as PB/DLL!!

      PowerBasic has allowed me to continue to write and think
      as a DOS programmer----- with-in the windows enviornment---

      You will be very Happy with PB/DLL B

      ------------------

      Let me add----DDT may drive you crazy at first---- But,
      Those problems are "Windows" Problems, not "PB" Problems--
      PowerBasic's DDT, just makes it easier to learn the
      SDK architecture.



      [This message has been edited by Brad D Byrne (edited September 25, 2001).]

      Comment


      • #4
        There is no better way to learn than to experiment with sample
        code and ask questions when you don't understand something. These
        forums and all the wonderful people who contribute to them helped
        me get over the Windows hump with PB/DLL in a matter of a few months
        (not to say I'm an expert now, but for the most part I GET IT now).

        I floundered around with VB for a long time before PB/DLL. My eyes
        would just glaze over after five minutes of reading any of the heavy tomes
        available for learning VB.

        I would personally encourage you to get PB/DLL and start experimenting
        with the abundance of source code here. You'll learn a heck of a lot
        faster than by reading any book.

        Also, download Borje's excellent POFFS offline search engine to research
        your questions.

        ------------------
        Bernard Ertl

        [This message has been edited by Bern Ertl (edited September 25, 2001).]
        Bernard Ertl
        InterPlan Systems

        Comment


        • #5
          Thanks Tom & Brad. I'll dl some code and look at it. Good idea.

          Tom, your name is very familiar. Did you used to monitor a BBS forum
          or something quite awhile back? Before here was a Windows
          to worry about. It seems to me I bought several disks of
          Basic routines from you(?)

          Anyway, thx replies.

          Swede



          ------------------
          Gösta H. Lovgren
          http://www.SwedesDock.com
          http://www.PondersBible.com
          [email protected]

          Comment


          • #6
            Gosta,

            I've been making the exact same transition over the last 12 months
            and found the non-linear nature to be a bit confusing. I certainly
            am a big fan of PBdll, but also think you should look into EzGui.

            You can download the free designer at www.ezgui.com, and when Chris
            Boss gets his international stuff in place then you can buy the
            real one. The free designer generates DDT code, which is a big help,
            but the real designer has a whole scheme (dlls) that encapsulates
            the most common API commands into a really easy and concise API.
            I don't program without in now.

            Good Luck,
            Russ Srole

            ------------------
            "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

            Comment


            • #7
              Hej Gösta,

              Going from DOS to VB is a terrible experience. Not only hard to understand
              where working code shall be put, but realizing a simple "Hello World" app'
              installation needs more than one diskette can give you horrible nightmares..

              Going from DOS to PB for Windows is much more fun. The PB/DLL compiler has
              something called DDT that makes the transition from DOS to Windows a lot
              easier. It sort of acts like easy-to-use wrappers for the Windows Application
              Programming Interface, API, which otherwise can be a bit tricky to understand
              in the beginning, when coming from DOS world.

              Best thing about PowerBasic compilers, beside the fact they produce
              extremely tight and fast code, is these support forums. Here we have,
              without competition, the best support team I have ever had the fortune
              to meet in the form of two extremely skilled and helpful fellows, Tom
              Hanlin and Lance Edmunds. Those two alone makes PB worth gold, IMHO..

              BTW, POFFS, mentioned by Bern, is a PowerBasic OFF-line Search program,
              with many thousands of Q&A and source code samples, compiled from posting
              to these forums. You can find it on http://www.tolken99.com/pb/pbfile_e.htm
              along with some other PB stuff I have posted there.


              ------------------

              Comment


              • #8
                Thanks, Borje! We've had plenty of opportunities to enjoy your fine contributions
                to the PowerBASIC community, also.

                Gösta, yes, I used to be quite active on the BBSes and Fido-era networks. I
                specialized in freeware and shareware libraries for BASICs and other languages:
                AdvBas, BasWiz, AABas, BasUpd, PBClone, QBWiz, AsmWiz, PBWiz, PasWiz, ObjTool,
                QBTiny, and so forth and so on. These days, I'm keeping busy enough with
                PowerBASIC!

                ------------------
                Tom Hanlin
                PowerBASIC Staff

                Comment


                • #9
                  Gösta,

                  With your background in normal procedural programming in DOS,
                  writing code in PowerBASIC will be a lot more familiar than an
                  environment like Visual Basic. The console compiler will be very
                  familiar as the dialect of basic is highly compatible with older
                  basic code, even though it is a true high performance compiler
                  in 32 bit.

                  The real monster is the architecture of Windows itself, where in DOS
                  you had direct control of the screen and coded your own loops to
                  base a program from, Windows has a different architecture which
                  is basically a windowing system that communicates through the
                  operating system by sending messages to different windows.

                  PowerBASIC simplified this complexity when it introduced the DDT
                  system and this makes the shift from DOS to Windows a lot less
                  painful. It will allow you to create dialog style applications
                  in a reasonably short time. As you get more familiar with the
                  architecture of Windows there is the full set of internal API
                  functions to play with and once you get the feel of it, you can do
                  far more things and a lot easier than in DOS.

                  Having PowerBASIC also means that you can still use VB for interface
                  development and write fast procedural DLLs for it so all in all,
                  PowerBASIC will work well for you once you get used to it.

                  Regards,

                  [email protected]

                  ------------------
                  hutch at movsd dot com
                  The MASM Forum

                  www.masm32.com

                  Comment


                  • #10
                    Thanks all your replies. It has given me the confidence to make
                    the jump/ I will likely do it this week.

                    And Tom I recall buying stuff from you and reading your code
                    for tips. IIRC, it was even before QuickBasic came out. Must be
                    close to 15 years ago now.

                    One more question, If I may. I have a <b>bunch</b> of stuff
                    I have written that have a HUGE amount of data in flat file
                    format. Will I be able to access those file with a GUI interface?

                    THat's probably not clear. What I want to do is read/write to
                    those existing files with a new Windows interface without
                    having to rewrite the file structures. IOW I guess what I am
                    asking is will I be able to continue using flat files as I
                    did with PDS? Building my own access indexes, etc.?

                    Or will I be locked into what appears to me to be an overly
                    complex table type system my friend (who is trying to make the
                    jump to VB) is fighting?

                    TIA - Gösta

                    ------------------
                    Gösta H. Lovgren
                    http://www.SwedesDock.com
                    http://www.PondersBible.com
                    [email protected]

                    Comment


                    • #11
                      Yes, you can read/write data files using any format you dream up.
                      There is no reason you would have to change your data file format.

                      PB allows three modes of disk I/O:

                      Sequential access files
                      Random access files
                      Binary access files

                      Search these forums for OPEN and you should see more examples
                      than you can read in a week I'd guess....



                      ------------------
                      Bernard Ertl
                      Bernard Ertl
                      InterPlan Systems

                      Comment


                      • #12
                        The real monster is the architecture of Windows itself..
                        I hope you meant "monster of a misdset change" rather than the Windows architecture itself.

                        I just love the Windows architecture, and often wonder how much better it could be if only Microsoft had not wasted so much talent developing Microsoft Word(r), one of the worst word processors on the planet, and the talent wasted in all MS applications adding cute little puppy dogs and old men asking me if I want more help or 'suggesting' my next actions....

                        Michael Mattias
                        Tal Systems Inc. (retired)
                        Racine WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          Michael,

                          I think from memory that I just about went blind and mad about
                          10 - 11 years ago when I started on the SDK for win3.0 My head
                          stopped hurting a few months later after I have learnt the
                          basic architecture but it was definitely a brain bender at the
                          time.

                          Fortunately the tools and toys now are far better than then and
                          the transition is somewhat less painful to 32 bit windows code.

                          I vote with my feet and use a 1992 version of WORD, last native
                          code version, loads instantly and does more than the "paper clip"
                          version as well.

                          I don't mind the architecture of a message driven windowing system
                          but there are enough irritations to take the fun out of it, bugz,
                          lousy documentation, unnecessary complexity from lousy code design
                          and of course the "policy" of Microsoft in keeping it that way.

                          Regards,

                          [email protected]

                          ------------------
                          hutch at movsd dot com
                          The MASM Forum

                          www.masm32.com

                          Comment


                          • #14
                            Gosta
                            I am still converting from PDS to PB.
                            If you are going to PBCC, you will probably be amazed how easy it is to convert much of your code (I was). The majority of it ran straight off, the only bits I had to really work at were some display functions written in assembler, & some custom mouse code.
                            All the rest was just search & replace. Then all my memory hassles, etc. just disappeared. Impressive!
                            But you'll miss the environment, especially the debugger.
                            I dont know how well this works with PBDLL however, I shall be finding out soon.


                            ------------------

                            Comment


                            • #15
                              I don't mind the architecture of a message driven windowing system
                              but there are enough irritations to take the fun out of it, bugz,
                              lousy documentation, unnecessary complexity from lousy code design..
                              Huh? Which Win32 API you been working with? The one from Microsoft?

                              Doc? If only the PB documentation were as good as the SDK documentation!!

                              Bugs? I can't find any bugs in the Windows calls (except my own when I call Windows incorrectly)

                              Complexity? Well, maybe my years of writing mainframe stuff have made Windows seem easier, but all those options = lots of programmer power. Who was it( Winston Churchill?) who said, "Give us the tools, we'll finish the job?"

                              Lousy design? As I said before, I think the WIn32 API is a great tool, and woujld be even better if MS had not wasted time and money to create "Word".

                              and of course the "policy" of Microsoft in keeping it that way.
                              Strongly disagree, but that should be obvious from my other comments.

                              MCM
                              Michael Mattias
                              Tal Systems Inc. (retired)
                              Racine WI USA
                              [email protected]
                              http://www.talsystems.com

                              Comment


                              • #16
                                And Tom I recall buying stuff from you and reading your code
                                for tips. IIRC, it was even before QuickBasic came out. Must be
                                close to 15 years ago now.
                                Your memory is excellent. I believe my AdvBas library for IBM
                                BASCOM 1.0/2.0 and Microsoft BASCOM 5.35? was first released in 1985.
                                The compilers were a short step from GWBASIC: horrible, really. Then
                                again, if I'd had PB/DOS 3.5 at the time, I might never had gotten
                                started writing libraries...

                                One more question, If I may. I have a <b>bunch</b> of stuff
                                I have written that have a HUGE amount of data in flat file
                                format. Will I be able to access those file with a GUI interface?
                                Oh yeah. Absolutely. The interface doesn't have anything to do with
                                the file handling. File handling in PB/CC and PB/DLL is, on the whole,
                                much more flexible than the old DOS BASICs-- although the FIELD statement
                                is obsolete. Record-oriented file handling is now done through user-
                                defined TYPEs instead. It's a pretty simple conversion to make, though,
                                and will make your program more efficient. And you won't have to change
                                your actual file format at all.

                                By the way, the UBB forum software uses [square] brackets for codes,
                                rather than the less-than / greater-than symbols used with HTML. Check
                                out the UBB code chart, here:
                                http://www.powerbasic.com/support/forums/ubbcode.html

                                ------------------
                                Tom Hanlin
                                PowerBASIC Staff

                                Comment


                                • #17
                                  Tom weren't you related to UltraShell at one point in time?
                                  That was by far, *the* absolute best tool I ever used wiht Dos programming....
                                  Besides PB/DOS that is hehe, PB/Dos rocked...still does for Dos stuff....


                                  As for non-linear stuff, I've been doing PB for wh at, 2, 3 years now and I'm no expert at it, but what is NICE is that there is almost NO problem any of us have come across that cannot be solved by someone up here on the BBS...

                                  And honestly speaking, that is probably 50% of why I stuck with PB...

                                  Sure, fast internet connections allow faster downloading of bloatware, and bloatware is easy to create these days (Just ask MS!), but still, when my TOTAL app, all files included is less than 500k and has a 350k bitmap in it...that speaks for itself...


                                  (And guys, my software is not self-destructive, it's fun to dream about but it is not)...


                                  Scott

                                  ------------------
                                  Scott Turchin
                                  MCSE, MCP+I
                                  Computer Creations Software
                                  http://www.tngbbs.com/ccs
                                  Scott Turchin
                                  MCSE, MCP+I
                                  http://www.tngbbs.com
                                  ----------------------
                                  True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                                  Comment


                                  • #18
                                    Related to UltraShell, hmm. Not by birth! Although, UltraShell is an EllTech
                                    product, and I did work for EllTech for some years. And UltraShell is sold by
                                    Information Management Systems, which also sells my former shareware library,
                                    PBWiz. So, I suppose it's my second cousin, twice removed, on my computer's
                                    side.

                                    ------------------
                                    Tom Hanlin
                                    PowerBASIC Staff

                                    Comment


                                    • #19
                                      Bern said:

                                      "Yes, you can read/write data files using any format you dream up.
                                      There is no reason you would have to change your data file format."

                                      I'm not concerned about the file format so much as I am about
                                      output format. ie printing to the screen (I made extensive use
                                      of Tony Elliot's NovaScreen in PDS and am unsure about being able
                                      to do similar stuff in Windows) and organizing the data.
                                      What I think has happened is my friend has gotten himself
                                      mired in something called Access, which appears to use a complex
                                      rigid relational database fomat for use in VB. And this, along with my
                                      own feeble efforts at deciphering VB, has made me very wary
                                      of Windows Basic.

                                      In any case I can see these forums will be a GREAT help when
                                      I get PB (ordered the Windows version over the last weekend).
                                      Much like the MicroHelp PDS forum was in the last century. It's
                                      very difficult self teaching a new language by yourself.




                                      ------------------
                                      Gösta H. Lovgren
                                      http://www.SwedesDock.com
                                      http://www.PondersBible.com
                                      [email protected]

                                      Comment


                                      • #20
                                        Gösta,

                                        Good move, getting on board PB/DLL. I'm a self-taught, untrained
                                        DOS programmer, who started writing shareware 15 years ago,
                                        knowing just enough about programming to get by with PowerBasic
                                        for DOS, which made text-based programming very easy even for an
                                        amateur programmer like me.

                                        I finally decided to try writing code for Windows, and bought
                                        PB/DLL 6.0 about a year ago. I have to admit that it took me
                                        about 2 months of reading and re-reading the PBDLL manual from
                                        cover to cover several times, and key portions about 10 times,
                                        before I began to get even a glimmering of how to write even
                                        the simplest code for Windows, which seemed totally illogical
                                        and non-linear to me, unlike DOS programming, which was mostly
                                        pure logic, "no prior experience needed."

                                        However, once I began to get a slight understanding of how
                                        code-writing with PBDLL works (which is obviously MUCH easier
                                        than any other approach to Windows programming), things began
                                        to come together quickly. And I would also highly recommend
                                        Chris Boss' EZGUI, which took me a few hours to figure out, but
                                        once I did, allowed me to design the whole GUI layout of my
                                        program in one evening! (Saving countless hours of writing the
                                        GUI code myself -- EZGUI generates the code for you, and you
                                        just paste it into your program. That's the freeware version,
                                        which I started with, and haven't been willing to change from
                                        to the paid version, which I hear is even better, but different,
                                        as I don't want to start over -- But I'll get the paid version
                                        for my next project, and you would probably do well to start
                                        with it, rather than the freeware version.)

                                        I think you'll be pleasantly surprised how quickly you can start
                                        writing Windows code, with PBDLL and EZGUI, once you get your
                                        feet wet.


                                        ------------------

                                        Comment

                                        Working...
                                        X