Announcement

Collapse
No announcement yet.

Petzold demo files

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

  • Petzold demo files

    The petzold demo files contain a lot of useful information I would like to share in my programs .
    However if I want to run the files I always get the error message : line 15182 is over 256 characters :split ...
    The lines are indeed very long . Is there a way to split them easily ?
    Second question : how is Petzold capable to run this programs with these long lines ? Need a special setting somewhere ?

  • #2
    Frank,

    It's a known limitation of PB Edit: lines can not be more than 256 characters long. You can easily split'm. Use a space plus an underscore:
    Code:
    MSGBOX "PB Edit reads these 3 lines as 1 command", _
            64, _
            " Header line"
    What do you think, was Petzold using Power Basic?
    Last edited by Egbert Zijlema; 19 Apr 2008, 06:01 AM. Reason: typo

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

    Comment


    • #3
      256 char limitation

      It's curious : the files themselves show up as the should in the editor but the error first occurs when compiling it .
      About your remark : Pedzold must have pretty good programming expierence . I don't know enough about Microsofts policy in relation to PowerB .

      Comment


      • #4
        Didn't someone post converted Petzold files here at some point...they may even be in the downloads or something by now.
        sigpic
        Mobile Solutions
        Sys Analyst and Development

        Comment


        • #5
          Petzold

          Yes , they are right "here"
          http://www.powerbasic.com/support/qu.../pbwin000.html
          and here : ( charles petzold )
          http://www.powerbasic.com/support/downloads/windows.htm
          Last edited by Frank Kestens; 20 Apr 2008, 10:17 AM. Reason: adding info

          Comment


          • #6
            Oops! - dupe
            Last edited by Dave Biggs; 20 Apr 2008, 10:20 AM. Reason: Redundant
            Rgds, Dave

            Comment


            • #7
              Error Message

              I am new to the Petzold stuff and I've tried out some of the above and in every instance, so far, I get an error in the following:

              lpCmdLine AS ASCIIZ PTR,_

              I see the samples were written for Windows 95 and I'm using Windows XP Pro on my two-week-old new computer.

              Can anyone help?

              Brian
              Brian.

              Comment


              • #8
                Change lpCmdLine AS ASCIIZ PTR to BYVAL lpCmdLine AS ASCIIZ PTR.

                BTW translations of the examples from the 5th edition of Petzold's book are available in my forum, and don't need modifications.

                http://www.jose.it-berater.org/smffo....php?board=5.0
                Forum: http://www.jose.it-berater.org/smfforum/index.php

                Comment


                • #9
                  I get an error in the following:

                  lpCmdLine AS ASCIIZ PTR,_

                  I see the samples were written for Windows 95 ..
                  The executable code from those samples should be 100% backward-compatible: if it runs on Win/95 it should run on Windows/anything.

                  There are however some source-code level backward-incompatibilities across compiler versions; this is an example. PTR parameters were always ASSUMED to be "BYVAL" up until PB/8x, in which release the use of the "BYVAL" keyword in the procedure header was made mandatory. (There were warnings in prior versions that this was coming).

                  (At least I think they were assumed to be that, I actually can't remember anymore if you could pass a PTR parmeter BYREF).

                  FWIW, other than new "keywords" being added to the compiler, there have been very very few backward incompatibilites in the compilers, going back all the way to the first 32-bit compiler (version 5). And AFIAK only two run-time incompatibilties, but both of those were between 6x and 7x so that should not affect you at all.

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

                  Comment

                  Working...
                  X