TurboPascal 6 fonction Not in TP3 
Author Message
 TurboPascal 6 fonction Not in TP3

Hi,

I use in my program in Turbo Pascal version 6 the variable "FILEMODE" to
open files in ReadOnly mode,

I search How I can do the same in the Turbo Pascal version 3.  I know that
the variable "FILEMODE" does not exist but if you know a way to do the same
help me please....

-----
Stphane Landry
Technicien informatique
Socit GRICS
Tl.: (514) 251-3700, poste 3966
Fax: (514) 251-3920

http://www.*-*-*.com/



Wed, 18 Jun 1902 08:00:00 GMT  
 TurboPascal 6 fonction Not in TP3

Quote:

>Hi,

>I use in my program in Turbo pascal version 6 the variable "FILEMODE" to
>open files in ReadOnly mode,

>I search How I can do the same in the Turbo Pascal version 3.  I know that
>the variable "FILEMODE" does not exist but if you know a way to do the same
>help me please....

I love a challenge.  In this case it helps to have reversed
engineered a copy of Turbo 3.01a as an exercise for learning
x86 assembly. ;-)

You'll have to zap the library's openfile mov AX,3D02h
instruction used for opening typed and untyped files.  That's
the technical side.  

The not so technical instructions are to compile and run the
following ditty.  If it beeps "Eureka!", then you can define
VAR FileMode: Byte absolute CSEG:$24FC;  Otherwise let me know
the three hex digits it prints and we'll try again.

    ...red

TYPE Str2 = String[2];
VAR x: Array[0..2] of byte absolute Cseg:$24FB;

Function Hex(x: Byte): Str2;
CONST H: Array[0..15] of Char = '0123456789ABCEDF';
Begin
    Hex := h[x shr 4] + h[x and $F];
End;

BEGIN
    If (x[0] = $B8) and (x[1] = $02) and (x[2] = $3D) Then
       Writeln('Eureka!'#7)
    Else Writeln(Hex(x[0]), ' ', Hex(x[1]), ' ',Hex(x[2]))
END.



Wed, 18 Jun 1902 08:00:00 GMT  
 TurboPascal 6 fonction Not in TP3

Quote:
>>I use in my program in Turbo pascal version 6 the variable "FILEMODE" to
>>open files in ReadOnly mode,

>>I search How I can do the same in the Turbo Pascal version 3.  I know that
>>the variable "FILEMODE" does not exist but if you know a way to do the
same
>>help me please....

>I love a challenge.  In this case it helps to have reversed
>engineered a copy of Turbo 3.01a as an exercise for learning
>x86 assembly. ;-)

>You'll have to zap the library's openfile mov AX,3D02h
>instruction used for opening typed and untyped files.  That's
>the technical side.

>The not so technical instructions are to compile and run the
>following ditty.  If it beeps "Eureka!", then you can define
>VAR FileMode: Byte absolute CSEG:$24FC;  Otherwise let me know
>the three hex digits it prints and we'll try again.

>    ...red

>TYPE Str2 = String[2];
>VAR x: Array[0..2] of byte absolute Cseg:$24FB;

>Function Hex(x: Byte): Str2;
>CONST H: Array[0..15] of Char = '0123456789ABCEDF';
>Begin
>    Hex := h[x shr 4] + h[x and $F];
>End;

>BEGIN
>    If (x[0] = $B8) and (x[1] = $02) and (x[2] = $3D) Then
>       Writeln('Eureka!'#7)
>    Else Writeln(Hex(x[0]), ' ', Hex(x[1]), ' ',Hex(x[2]))
>END.

Thanks for the help
but that does not work for now, there is the three digits (8F 06 86)

just to be sure that we talk about the same think.  The only think I want to
do is to open a text file at the same time from two station on a NT server.
On a Novell server I only put the file Shareable.  In Turbo Pascal 6 when I
put the FileMode at 0 I'm able to open a single file at the same time from
many station on NT server

Thanks again for the help



Wed, 18 Jun 1902 08:00:00 GMT  
 TurboPascal 6 fonction Not in TP3

Stephane and I resolved the problem through email.  I was working
with a PC-DOS 3.01A version of TP and she had an earlier PC-DOS
3.00B version.  The 3-byte instruction in the earlier version is
located at $248C so filemode for the two versions can be defined
as:

{VERSION 3.00B} VAR FileMode: Byte absolute CSEG:$248D;
{VERSION 3.01A} VAR FileMode: Byte absolute CSEG:$24FC;

    ...red



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

 Relevant Pages 

1. Recrutement d’un ingénieur développeur pour fonction chef de projet

2. ReadKey Function (TP3)

3. Redefine Characters In TP3

4. Need TP3 and Turbo Database Toolbox for legacy app

5. Posting Editor shortcuts for TP3

6. TP1 or TP3 Docs wanted

7. Urgent:need help with TP3.0

8. WANNA BUY TP3.0 FOR DOS!!!

9. Any TP3 issues on fast CPUs?

10. Looking for Tp3, tp4, or tp5

11. WANNA BUY TP3.0 FOR DOS!!!

12. TP3.0 for CP/M

 

 
Powered by phpBB® Forum Software