Announcement

Collapse
No announcement yet.

General Question About PBU's, PBL's, etc.

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

  • General Question About PBU's, PBL's, etc.

    Note to Lance and Tom - I started a topic pretty much the same
    as this one in the 3rd-party Forum. I know y'all dislike
    cross-posting, so I deleted that original posting.

    Here's the scenario: I have been in the process of creating a
    PB/DOS 3.5 API to be used for writing programs that manipulate
    the TriBBS BBS database files. Up until I stopped writing TriBBS
    utilities/doors about 12 months ago, I was using a Freeware,
    fully developed/debugged API that was written by one of the
    previous trademark owners of the TriBBS BBS software.

    The problem: that API written by the other fellow is a comprehensive,
    exhaustive API, and is an EXCELLENT API, with ONE exception: he
    somehow coded his PBU's/PBL so that programmers who use his API
    *must* use $DIM ALL and DEFINT A-Z. Well, and I know it's being
    iconoclastic, but I *hate* having to explicitly declare EACH and
    EVERY variable in my source code. It's more of a pain than a help,
    to me, anyway. 'Sides, I've NEVER had a problem with errant variable
    names and I *never* use #DIM ALL (32-bit) or $DIM ALL, unless I
    *have* to.

    Finally, the question: do any of you experienced programmers, or
    BBS Administrators, know of a way to stop the API from REQUIRING
    $DIM ALL and DEFINT A-Z in my main program's source file in order
    for it to compile? When I try to write/compile my source code
    WITHOUT them, I always get an error message: DUPLICATE DEFINITION
    on one or other functions contained within the PBL. Once I insert
    the $DIM ALL and DEFINT A-Z back into the source, they compile just fine.

    *IF* one of y'all can provide me with a workable solution/workaround,
    then I'll drop my own API-writing project, as that other guy's is
    already excellent (and Free), except for the noted irregularities.

    Any ideas would be GREATLY appreciated!

    Thanks in advance!

    Cordially,

    ADDENDUM: FYI, to whomever reads/answers this post, I can't ask
    the other fellow for help on using his API. Up until 6 months
    ago, we were on each other's ICQ Contact Lists. But, I'm afraid
    I seriously offended him at that point. He's an all-the-way VB
    fan, while I think it's needless "bloatware." Well, he had
    written a TrIBBS Freeware files database program to assist
    sysops in changing the drive letters in the database. But, like
    is typical of VB code, it was "fat" and needed all kinds of
    runtime dependencies. So, I wrote my own version of the program,
    that did the same thing (albeit with a different user interface)
    in PB. My program was only 23KB in size, twice as fast as his, and the
    only runtime dependencies in it were the standard Windows API
    DLL's. So, I "rubbed his nose in it." I did *specifically* tell
    him that I was NOT making fun of HIM, or his programming abilities,
    that I was just bashing VB. But, that was the last time he
    corresponded with me. I deserved it, because I shouldn't have
    rubbed his nose in it, even though I was doing it in jest.

    Anyway, I apologize for this long addition to my original post -
    I just want you other members to understand why I *can't* go to
    the guy directly for his help with using his API.

    ------------------
    Clay C. Clear

    mailto:[email protected][email protected]</A>

    Clay Clear's Software

    [This message has been edited by Clay Clear (edited September 07, 2001).]

  • #2
    The problem: that API written by the other fellow is a comprehensive,
    exhaustive API, and is an EXCELLENT API, with ONE exception: he
    somehow coded his PBU's/PBL so that programmers who use his API
    *must* use $DIM ALL and DEFINT A-Z.
    I would not call that an "API." To me, an API means you call some precompiled thing (*.OBJ, *.PBU or *.PBL) in which the calling code is independent of the called code.

    Sounds to me like you have an $INCLUDE file. If DEFINT or DIM ALL is required, they can be eliminated by changing the $INCLUDE file.

    Or, to do it the easy way, re-code your program as minimally as possible, putting all the cool stuff in a PBU file of your own. Use DEFINT and DIM ALL only in modules which actually call the external stuff.

    MCM


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

    Comment


    • #3
      Michael,

      Thanks for your reply! I am one step ahead of you, though, in that
      I loaded the guy's INC file into my MS-DOS Editor and did a search
      for ALL occurrences of "dim" and "defint". Didn't find ANY "defint",
      and there were also NO "dim all"'s. However, you may have given me
      a hint for something else to try. For a LONG time, my master INC
      file, which I use in EVERY PB/DOS program, includes ALL the other
      INC's, including QPP, the other guy's API, my own sorta-finished version
      of the API, and the DECLA's for my custom-written GP PBL. So, I'm
      going to go check the QPP INC file. I *know* that my own INC's
      don't have the DIM ALL or DEFINT A-Z, as I have never desired to
      use those settings. But, MAYBE, the clue lies in the QPP. I don't
      think I included it in the majority of the TriBBS utils that I wrote
      ages ago, but it's worth a shot.

      Thanks for the tip!

      Cordially,


      ------------------
      Clay C. Clear

      mailto:[email protected][email protected]</A>

      Clay Clear's Software

      Comment


      • #4
        OK, that didn't pan out. Any other ideas, fellow members?
        I actually would have no problem with finishing writing my own
        version of the API, except that it's only half done at this
        point, and it'd take three days of straight coding to finish it, not
        to mention the three WEEKS it'd take to fully test/debug the
        finished API, which would have MANY FUNCTION's/SUB's in it. That
        wouldn't be a problem, either, except that it's not a "pet"
        project of mine - I'm only doing it out of (self-conceived)
        necessity, so, I don't want to have to bother with it if I don't
        have to, such as getting the other version to work RESPONSIBLY.

        BTW, I just realized the (maybe?) irrational idea of thinking that
        the problem is being caused by an INC file - to my knowledge, an INC
        file can't FORCE a main source file to HAVE to use features, at
        least as far as $DIM ALL and DEFINT A-Z are concerned. In fact, if
        they already existed in the INC file(s), then the main source
        wouldn't even NEED them.


        Any ideas, anybody?

        Thanks in advance!

        Regards,


        ------------------
        Clay C. Clear

        mailto:[email protected][email protected]</A>

        Clay Clear's Software

        [This message has been edited by Clay Clear (edited September 07, 2001).]

        Comment


        • #5
          Dig a little deeper. As Michael suggests, the problem is almost certainly
          in one of the include files for the routines in question. Probably, one
          of the problems is some use of variables or parameters where the type is
          implicit. Without the DEFINT, these values are defaulting to the wrong
          type. You need to track down these values and apply explicit "%" type
          specifiers or DIM 'em AS INTEGER.

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

          Comment


          • #6
            Tom, Michael,

            Thanks for taking the time to read my longwinded postings, and replying
            to them.

            Turns out that i might not have to do any digging of my own. I
            finally "took my courage out of my pocket" and requested the ICQ
            Contact List authorization of the guy who wrote the original
            API, and just two minutes ago, he granted my request. <big toothy
            grin> Even if he can't help me (unlikely in the extreme, as,
            despite the flaw in his API, he's still a pretty good programmer),
            , it'll be GREAT to resume our "friendship."

            OK, enough soppy stuff. <chuckle>

            Michael,

            I apologize for misunderstanding what you meant about checking the
            INC's - I had assumed that you meant checking for the $DIM ALL
            and DEFINT A-Z statements. Tom has clarified for me what you
            were actually referring to.

            At any rate, I won't post anymore messages in this thread until and unless
            I have exhausted every avenue that I can think of.

            Thanks again.

            Cordially,


            ------------------
            Clay C. Clear

            mailto:[email protected][email protected]</A>

            Clay Clear's Software

            Comment


            • #7
              THANKS, TOM AND MICHAEL! You guys were EXACTLY correct! Turns out
              that it wasn't an actual flaw in the API - it was a programming
              technique that I'd never run across before. Tom got me on it when
              he mentioned the "implicit variable declaration". Turns out that
              the FUNCTION DECLARE's in the API's INC file used the implicit
              INTEGER definition (via DEFINT A-Z) to define their type
              identifiers. So, to test that theory, I went through all the file
              area database's DECLARE's (that is, for the PBU that accesses the
              TriBBS BBS File Areas) and manually appended AS INTEGER to the
              applicable declare's. Then I wrote a small test program, the same one
              that would never even compile before, and it compiled correctly
              the FIRST time, and the test EXE worked perfectly.

              So, you two fellows have saved me WEEKS of writing/testing/debugging
              my own API.

              Once again, my heartfelt thanks!

              Best regards,



              ------------------
              Clay C. Clear

              mailto:[email protected][email protected]</A>

              Clay Clear's Software

              Comment

              Working...
              X