No announcement yet.

.BAS file size restriction

  • Filter
  • Time
  • Show
Clear All
new posts

    .BAS file size restriction

    For information: the .BAS source file is restricted to 16,384 lines, I have now discovered. My project is nowhere near halfway done, but this presents no real problem since selected areas may be relegated to DLL status and called for at much the same price. It does underline that the GUI side of things needs a lot more code than the real work (number crunching and straight data processing) in the background. My fourteen DLLs compile to approx. 3.5Mb. The the biggest DLL file is 262K of code and compiles to 499K, whereas the exe (GUI side of things) is 506K of code and compiles to 418K

    It helps to point one in a direction of organising the overall project that much more, in broad, overall terms, into macro-structured shape.

    A single BAS file is limited to 16k lines (this is an IDE limit, not a compiler limit) but there's no need to break up your program and create DLLs because of this limit. You can create single-module programs that are many, many times that size by using the $INCLUDE/#INCLUDE metastatement.

    Your main program would look something like this...

    FUNCTION WinMain (etc)
      (main code)
    (and so on)
    Personally, I never even get close to the 16k limit because I keep related functions organized in many different files.

    Using #INCLUDE also makes it very easy to create generic functions that can be included in many different programs.


    -- Eric

    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    [This message has been edited by Eric Pearson (edited June 13, 2000).]
    "Not my circus, not my monkeys."



      PB is no different than C or any other high level language in the respect that you need to develop structured or modular programming practices. Your long winded source code files will definitely become a royal pain to maintain in the future unless you follow these programming principles.

      Any of the books Lance has recommended will give pointers to this effect. Happy programming!!!





        A must read for all programmers, no matter what language they use is:

        Code Complete
        by Steve C McConnell

        It shows the right and wrongs ways to do things, comments, variables, globals, modules, and modules size. It is a great book.

        From the Author's Preface: My primary concern in writing this book has been to narrow the gap between the knowledge of industry gurus and professors on one hand and common commercial practice on the other. Although leading-edge software-development practice has advanced rapidly in recent years, common practice hasn't. Many programs are still buggy, late, and over budget, and many fail to satisfy the needs of users. The research and programming experience collected in this book will help you to create high-quality software and do your work more quickly and with fewer problems.

        A practical reference to software construction from design to testing includes examples in C, Pascal, Basic, Fortran and Adabut, for guidance in developing programming techniques. Original. Here is a thorough expert look at the intricate process of commercial software development. The text is rich in example code, contains powerful insights on managing technical yet creative people, and examines each milestone in software development in considerable detail. Ideal for professional, self-taught, and student programmers.



          Originally posted by Tim Wisseman:

          A must read for all programmers, no matter what language they use is:

          Code Complete
          by Steve C McConnell
          I heartily second this opinion. It is an outstanding book to help you make cleaner, clearer code. I would say its best companion book is

          Debugging the Development Process
          by Steve Maguire

          which points out the processes and habits that both programmers and management get into that kill their productivity and their coding. Maguire also wrote "Writing Solid Code" which is a C-specific book that points out common pitfalls and errors in C-programming. It's also a very good book, but if I had to pick between the two, I'd pick "Debugging the Development Process". Using the ideas in that book literally *quadrupled* my output, and "Code Complete" made me try to enforce the "no bugs, no exceptions" style in my coding. The best thing about these books is they're all "cheap" compared to most $49.95 and $59.95 books programmers have to buy. They're all between $20 and $35US. Now if only I were any good at programming *grin*.

          Troy King
          [email protected]
          Troy King
          katravax at yahoo dot com


            Thank you, one and all! Eric, I appreciate the bit about #include
            - this was available under Pb for DOS, and I used it all the time. Here and now, I want to keep the size of both the main Exe as well as the DLL's within reasonable limits, considering Internet download time, and maintainability via specific module upgrading rather than a total re-download.

            However, have now continued by doing more GUI work in a new DLL module which will be dedicated to totally interrelated activities only, and so far it goes well. Lightning fast, too, on my pre-war 166Mhz Pentium!