Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Fella

Files in pascal

This topic is 5724 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

var f: file of integer; i: integer; begin assign(f, ''numbers.dat''); rewrite(f); for i := 1 to 10 do write(f, i); close(f); end. When I open numbers.dat with Notepad I get: Why don''t I get 1..10?

Share this post


Link to post
Share on other sites
Advertisement
You''ve stored in the integers in binary format, the same format used by the computer. Depending on your compiler version they will be stored as 2 or 4 bytes each. If you want to store your numbers as plain text (the kind you can read in notepad) you can declare f as a variable of type text, however storing information like this is less efficent, as time is spent converting to and from string representations (it also introduces the change that the text does not represent a valid number, which would generate errors)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!