Announcement

Collapse
No announcement yet.

#utility

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

  • #utility

    What can the new statement "#UTILITY"? What's the point?

  • #2
    Originally posted by Bernhard Fomm View Post
    What can the new statement "#UTILITY"? What's the point?
    It's for third party tools.
    The compiler ignores everything on the line(s)
    I'm using it to describe Class Information to be read by a class browser

    James

    Comment


    • #3
      First came the #PBFORMS metastatement, which is used by the PB-Forms source-code generator system. #UTILITY is intended to be a generic version of the #PBFORMS metastatement, for use by external programs like source-code-lint detectors, spell-checkers, etc.

      -- Eric
      "Not my circus, not my monkeys."

      Comment


      • #4
        Ahhh...Thanks!

        Comment


        • #5
          ?

          so ....

          #Utility "some text here"

          You mean that this is for an external utility to read this line of text from the source code file *.bas ?

          I had the impression that the information was somehow encoded in the compliled *.exe or *.dll file. If that was the case, I was wondering how to read it? In case someone wanted to write a utility to access the imbedded string.

          Comment


          • #6
            Well, I think the online help explains it pretty well...
            #UTILITY metastatement
            Purpose
            Compiler directive to allow external utility programs to read text inserted on the #UTILITY line.

            Syntax
            #UTILITY "any text for an external program"

            Remarks
            The entire line is ignored by the PowerBASIC compiler.
            Basically it sounds like 'token' for which you may parse the source code, knowing there will be only one and knowing the text will be the first whitespace-delimited characters following.

            If it's ignored by the compiler, it ain't in the compiled PE file.

            And "In case someone wanted to write a utility to access the imbedded string" I just addressed above.

            If you want something in the PE file, use program resources; that's why they exist.


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

            Comment


            • #7
              ok

              ok ... noted

              I read the help file a bit differently ... ignored by the PowerBASIC compiler. ... hmmm.

              It could have meant did not produce executable instructions, but still could mean imbed (like a resource) into the .exe file; However, Michael, I'm sure you are correct ... I wish that the help file was a bit more descriptive in some cases ... this is one of those.

              So... bottom line. It's for all intent and purpose, a comment. It's just a unique tag that can be found and parsed to find sting "xyz" that follows the #Utility statment.

              Comment


              • #8
                Originally posted by Michael Mattias View Post
                Basically it sounds like 'token' for which you may parse the source code, knowing there will be only one and knowing the text will be the first whitespace-delimited characters following.
                MCM
                You can have as many as you want.

                James

                Comment

                Working...
                X