Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Read and Write Command Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bijx




PostPosted: Wed Apr 02, 2014 6:37 pm   Post subject: Read and Write Command Help

Hello interwebs,

I am trying to write text files in turing, using the open, put, and get command.

My problem is that I don't fully understand how to use get or read.

This is my command so far but I don't understand what to do with read. What is the part after my stream variable? Why can't I simply ask it to open the whole file?

code:

var stream : int
var test : string
open : stream, "Text.txt", put

get test : *


put : stream, test

read : stream, test


Thanks,
bijx
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Apr 02, 2014 8:26 pm   Post subject: RE:Read and Write Command Help

take a look at the documentation for open and go from there.

Something to keep in mind:

- you'd need to specify the operations you will use on the file when opening it, before performing those operations.
- get is easier to understand than read, as the later deals with binary data instead of text.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: