Announcement

Collapse
No announcement yet.

Where does 'pbvScrnHost' come from in MOUSUNIT?

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

  • Matthew Berg
    replied
    under Windows 2000, that code reports Windows NT and says it is unable to determine the version number
    I have Windows 2000 on my home PC, but hadn't got around to testing that code on it. I'm not really surprised by your results. As previously discussed in these forums, there is no official and reliable way (I don't count checking environment variables as reliable) for a DOS application to determine if it is running on Windows NT, let alone the difference between NT and 2000. The source code at the link I posted exploits a quirk of NT's DOS emulation that I noticed during testing which I can only assume is "reliable" and persistent.

    Anyway, Windows 2000 is really Windows NT 5, so the code is sort-of correct. If anyone has any good ideas on how a DOS application can detect the difference between NT and 2000, I'm sure there are enquiring minds that would like to know!

    [This message has been edited by Matthew Berg (edited January 17, 2001).]

    Leave a comment:


  • Lance Edmonds
    replied
    Great work! I'd long forgotten about that posting in the archive...

    FYI, under Windows 2000, that code reports Windows NT and says it is unable to determine the version number.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Matthew Berg
    replied
    is there any bit that can be seen from pbcHost that can tell me if OS/2 is running, or, specifically WIN-95 or WIN-NT is running, as opposed to WIN-3.1 that is provided?
    There is PB/DOS source code in the archives to do this: Determine OS platform and version from DOS

    Leave a comment:


  • Mike Luther
    replied
    Thanks Lance ..

    ------------------
    Mike Luther
    [email protected]

    Leave a comment:


  • Lance Edmonds
    replied
    I can't tell you about OS/2 (I've never run it), but BIT(pbvHost,8) returns TRUE for Windows 3.x and Windows 95/98 (and I _assume_ WinME too). It returns FALSE under Windows NT/2000, just as it does with plain DOS.


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Mike Luther
    replied
    Ye Gadds, Lance!

    No wonder I didn't ever see it! To me, "on-line" help would and does
    mean help I can get while "on-line" with PowerBASIC via the IP
    connection!

    Huge Grin! I've been going back time and time again to look through
    the manuals, all over the PB Web site .. Now you all can have a huge
    laugh at Mikey's expense here, that's fine with me! Grin.

    Besides, what else would you expect from a place where people go get a
    quart of milk from the convenience store two blocks away in a Ford
    F-350 dual wheel one-ton crew cab diesel with an 89 gallon tank that
    costs a hundred bux to fill these days?

    or really more like ;(

    Now I understand! Gee... while we are at this, is there any bit
    that can be seen from pbcHost that can tell me if OS/2 is running,
    or, specifically WIN-95 or WIN-NT is running, as opposed to WIN-3.1
    that is provided?

    ------------------
    Mike Luther
    [email protected]

    Leave a comment:


  • Lance Edmonds
    replied
    Yes, it is an internal variable. It is not in the manual, but in the online help, under Internal Variables, along with pbvHost, etc.



    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Mike Luther
    started a topic Where does 'pbvScrnHost' come from in MOUSUNIT?

    Where does 'pbvScrnHost' come from in MOUSUNIT?

    The snip from MOUSUNIT in the examples section of PB 3.5 for DOS:

    Code:
    IF (pbvScrnMode = 7) OR (pbvScrnMode = 0) THEN
      Row    = (Row \ 8) + 1   'if text mode, then fix coordinates
      Column = (Column \ 8) + 1
    END IF
    has the variable pbvScrnMode in it. I think I understand correctly
    that this is the variable chosen to identify what screen mode we are
    using so that Mr. Mouse will give us the right coordinates depending
    on whether we are in Text mode, etc. Fine.

    But where is it defined? If you are not, for example, going to use
    the pure PB supplied PB35.INC declares, make a library out of this or
    that, but use the pure routine in your source, you can, simply add
    the mous functions to your own source, and skip the .PBL or PBU game.

    Maybe.

    As far as I can tell, pbvSrcnHost is some sort of an internal function
    in the PB 3.5 compiler, at least it happens to be declared somewhere
    else other than I can see it! If so, where? Where is there a list
    of these internal functions in PB so that any normal programmer can
    avoid using the variable names for something else, inadvertently, and
    a description of what they do and what they provide?

    I hit this quite by accident. For cosmetic reasons, I happen to prefer
    hard coding the variable type with a designated type identifier at the
    end, such as the % mark for integers, the ! mark for singles and so on.
    Each and every variable, no matter where it is used in my source has
    the trailing mark. Yes, I know Messr. Gates and M/S does not want to
    do this in Visual Basic from my experience with VB which actually *DOES*
    exist for us OS/2 folks, and I have. But I don't like that! Why?

    Because, I have an autoconverter that I now have working for some 140 of
    the 230-odd functions that PB 3.5 has I use in PB which converts PB 3.5
    source to C++ code automatically for use in WATCOM v11B. I've discovered
    that a cheap dirty way to handle type conversions, is to simply add the
    type mark to every variable. The source converter then adds an appropriate
    trailing 'identifier' in C source, such as (.int) or (.sng) that easily
    shows every single variable type, even in C source. When your suite contains
    close to 2500 commond distributed variables across over 800,000 lines of
    source, to administrate the code with descriptive variable names is, of
    course, the only way you could realisticly, or at least I can, keep
    track of what they do! That *ALSO* extends to the ease in following through
    the whole suite as to what *KIND* of variable this creature is.

    Extending that concept to C++ has proved a great help to me in running
    dual source operations between PB 3.5 for DOS and Watcom C++ for various
    other operating systems in my test suite at this..

    So .. to properly let my auto-translator add the variable type for this
    little lonely "pbvScrnMode" variable, I added a "%" mark to it.

    Blam .. PB 3.5 objected! Even though it is defined *NOWHERE* else by me in
    the source, PB 3.5 for DOS insists that as "pbvScrnMode%" is a duplicate
    definition for the variable. Just becasue I add the "5" mark to the tail
    end of it. Chuckle..

    I think that proves it must be a hidden internal function in PB 3.5 for DOS!

    No?

    OK, so then where is it defined? How do we get it? How many more of these
    little mites are floating around in here that I just might accidently corrupt
    if I use it for something else?

    Where is a list of this stuff published in the documentation or made available
    for the unwary? Surely that's not something that one would hide from the user,
    yet nowhere in the documentation, nor the on-line search or it in the PB site,
    can I find any hit for the source for this or, for example some other of these
    ingenious "pbv..." creatures!

    Inquiring mind wants to know!



    ------------------
    Mike Luther
    [email protected]
Working...
X