Orlando Llanes wrote:
PROGRAM Tmp;
var F : File Of Byte; V : Char;
BEGIN Assign( F, 'tmp.txt' ); Reset( F ); BlockRead( F, V, 1 ); Close( F ); END.
BlockRead and BlockWrite only work with untyped files (simply `File'), not typed files (`File of Byte'), just like in BP. So try:
PROGRAM Tmp;
var F : File; V : Char;
BEGIN Assign( F, 'tmp.txt' ); Reset( F, 1 ); BlockRead( F, V, 1 ); Close( F ); END.
(The 1 in the `Reset' is needed because of compatibility to a stupid CPM legacy in TP.)-:
-- Frank Heckenbach, frank@fjf.gnu.de http://fjf.gnu.de/ PGP and GPG keys: http://fjf.gnu.de/plan
On Wed, 11 Nov 1998, Frank Heckenbach wrote:
BlockRead and BlockWrite only work with untyped files (simply `File'), not typed files (`File of Byte'), just like in BP. So try:
I get a bunch of weird parsing errors if I only use FILE, besides, the problem was not that the file was not being read, the problem is that BlockRead is not being recognized as a built-in routine.
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414
Orlando Llanes wrote:
I get a bunch of weird parsing errors if I only use FILE, besides, the
problem was not that the file was not being read, the problem is that BlockRead is not being recognized as a built-in routine.
Are you sure that you are running gpc-19980830? It may be that your old installation is still present. If you have files `gpc-cpp.exe' and `gpc1.exe' in `/djgpp/bin/', try to remove or rename them. The current version of GPC keeps these files in `/djgpp/lib/gcc-lib/djgpp/2.81/'. The same holds for `/djgpp/lib/libgpc.a'.
You can run `gpc -v foo.pas' in order to check which instance of `gpc1.exe' is being used.
Hope this helps,
Peter