TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jonathan De Boyne Pollar
from: Thos Davis
date: 1996-01-31 20:44:00
subject: Help a beginner!

[ Jonathan de Boyne Pollard responds to my posting ]

JDBP| For portability across compilers, the VIO subsystem is the
    | *BEST* idea, not an afterthought as you seem to imply.

JDBP| The reason for this is that the VIO subsystem is part of the
    | system [...]

Perhaps this is my fault for trying to be succinct and not including
more of the original message with my posting.

Originally Richard Glidden had written to David Andrews

RG| I'm in the exact position that you are in, only I'm using Watcom
  | C/C++ v10.5.  I haven't done much C programming in either DOS or
  | OS/2 environments, and I'm finding OS/2 Programming to be more
  | trouble than it's worth to start. (Mainly because I haven't
  | signed up for "DevCon", because I don't have enough money...)

For someone who finds OS/2 Programming  more trouble than it's
worth, I think that using supplied libraries is a completely
reasonable alternative to using the VIO system calls. Additionally,
I don't know of many beginner programmers who use multiple compilers
(especially those who don't have lots of money). So portability
across compilers would not seem to be an important issue in this
case. And of course, as we all know, the best solution varies
according to the problem. There is never only one best solution to
all possible problems.

As for the suggestion that using system calls is the most portable
solution, I have to point out that the method of calling 16 bit (and
all VIO calls are 16 bit) code from otherwise 32 bit code, does in
fact vary according to compiler. Certainly the most portable text
mode calls would be those that are ANSI standards, as are those in
STDIO.H.  The problem with those is that they are slow. And so I
suggested that other less portable alternatives also exist which are
much faster.

Mr. de Boyne Pollard also adds,

JDBP| I don't know what you are thinking of when you suggest looking
    | at the generated code for a call to a VIO function.  That's
    | hardly going to be much help, since that is just a (thunked)
    | function call.  Looking at code to push parameters onto the
    | stack is hardly going to tell you what the function being
    | called does.

I did not mean to suggest looking at the assembler output of VIO
calls, but rather of library calls for text output routines. While
many of the compilers' library calls might be one to one
translations of VIO calls, some might be a little less straight
forward, and seeing their implementation could be very useful. With
the information available for system calls in OS/2 compilers, and
with an idea of what the library call does, the "what" is not
usually the problem, but the "how" is. Of course if all of the
library calls were exact duplicates of VIO calls, then that would
suggest that they were the very best choice for a beginner with one
compiler.

I hope that this clears up the questions regarding my previous
posting on this topic.
___
 X SLMR 2.1a X 

--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, Fairfax, VA: 703-385-4325 (1:109/347)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 109/347 716 13/25 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.