problems reading binary file, and outputting to screen. 
Author Message
 problems reading binary file, and outputting to screen.

    I having problems with outputting to the screen when reading from a
binary file.

I start it like so

begin
    with record do
        begin
        read(record,something);
        read(record,here);
        write(record,here);
        write(record,something);
    end;
end

Is that correct? if not, can someone help me please thanks.



Wed, 18 Jun 1902 08:00:00 GMT  
 problems reading binary file, and outputting to screen.

Quote:

>     I having problems with outputting to the screen when reading from a
> binary file.

> I start it like so

> begin
>     with record do
>         begin

>         read(record,something);
>         read(record,here);

Is this correct? I think record is a RECORD or is it a ASSIGNED FILE?

Quote:
>         write(record,here);
>         write(record,something);

This statement says IMHO: "write here to record" where record is a
assigned file.
If you want to put here to the screen you must do something like this (i
think here is a part of the RECORD record):
   Write(record.here);

Quote:

>     end;
> end

> Is that correct? if not, can someone help me please thanks.

I hope everything i said is correct!

cu
  Andre

--
Thiesen                          | Andre Wohnig

Im Tiegel 9                      | www.thiesen.com
3637 Wartenberg-Angersbach       | +49 (0) 66 41 979-142



Wed, 18 Jun 1902 08:00:00 GMT  
 problems reading binary file, and outputting to screen.

Quote:

>    I having problems with outputting to the screen when reading from a
>binary file.

>I start it like so

>begin
>    with record do
>        begin
>        read(record,something);
>        read(record,here);
>        write(record,here);
>        write(record,something);
>    end;
>end

That is total nonsense. I cannot make head or tail what you want to
achieve.

What are something and here? Record is a reserved word so it cannot be
used in the way you want.

If you want to output it in the screen, then you have to output a
field at a time.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 problems reading binary file, and outputting to screen.

Quote:

>     I having problems with outputting to the screen when reading from a
> binary file.

> I start it like so

> begin
>     with record do
>         begin
>         read(record,something);
>         read(record,here);
>         write(record,here);
>         write(record,something);
>     end;
> end

> Is that correct? if not, can someone help me please thanks.

No.
var box:
        record
        length,
        width: integer;
        end;

begin
readln (box.length);
           ^ use a period to dereference the record not a comma.        
readln (box.width);
write (box.length);
...
end.



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

 Relevant Pages 

1. reading binary file and outputting to standard output (screen)

2. problem reading 4-byte reals from binary file

3. Q: How to redirect output to screen AND a file

4. redirecting output from the screen to a file

5. Converting binary (text file) to compress binary file

6. Program to read TIFF files and output them to another format

7. Can Excel read a Pascal binary file?

8. I need to read a binary file

9. Reading binary files in pascal

10. Reading binary files in PASCAL ??

11. problem reading from text screen memory

12. Binary memory output.

 

 
Powered by phpBB® Forum Software