Is IOResult really a function? 
Author Message
 Is IOResult really a function?

I noticed something peculiar the other day. I was debugging a program and
placed IOResult in the watch window. Immediately after, I realised that
IOResult is supposed to be a function and I will probably get the pointer to
it. But to my surprise, I actually got the error code displayed instead.
This makes me wonder, is IOResult really a function and does it really clear
the error code so that further io operations are possible.


Wed, 18 Jun 1902 08:00:00 GMT  
 Is IOResult really a function?

Quote:

>I noticed something peculiar the other day. I was debugging a program and
>placed IOResult in the watch window. Immediately after, I realised that
>IOResult is supposed to be a function and I will probably get the pointer to
>it. But to my surprise, I actually got the error code displayed instead.
>This makes me wonder, is IOResult really a function and does it really clear
>the error code so that further io operations are possible.

It depends on which level you view things. On source code level it is a
function but on object code level it might not be. Same applies to all
system unit routines like for example write() or ord(). This has nothing to
do with the function of the routine. It does what is documented. The issue
is how it does it. IOResult actually produces a decent far call to a
subroutine:

; IOResult standard function. May modify only AX.

GetIORes:

        XOR     AX,AX
        XCHG    AX,InOutRes
        RETF

However, as the comment tells the calling requirements differ from
standard routines. That is the compiler can assume that it preserves
most registers.

If you need to pass a system unit routine as variable parameter, call
them from ASM etc. then you need to write a wrapper routine. For example

Function GetIOResult:integer;
Begin
  GetIOResult:=IOResult;
End;

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am really sorry

2. I am really pissed now!

3. I am looking for a RANDOM function...

4. I am looking for a RANDOM function...

5. help a realy really really new person at pascal

6. * WINDOWS 95 REALLY REALLY Dangerous ???!! *

7. IOResult=152?????

8. IOResult=105 (sometimes)

9. TP7 IOResult errorcodes

10. IoResult

11. Does a dos shell cause IOResult problems?

12. BP7/DOS in Win95 DOS Box - IOResult problems

 

 
Powered by phpBB® Forum Software