No announcement yet.

Petzold demo files

  • 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

    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:
    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)
    *** Opinions expressed here are not necessarily untrue ***


    • #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 .


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


        • #5

          Yes , they are right "here"

          and here : ( charles petzold )

          Last edited by Frank Kestens; 20 Apr 2008, 10:17 AM. Reason: adding info


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


            • #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?



              • #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.



                • #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.

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