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

Username:   Password: 
 RegisterRegister   
 How do I get my program to read text from a datafile?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
zOriginaL




PostPosted: Sun Jun 13, 2010 6:47 pm   Post subject: How do I get my program to read text from a datafile?

What is it you are trying to achieve?
I'm trying to import text from a datafile and put it on the run window.
Sponsor
Sponsor
Sponsor
sponsor
Unnamed.t




PostPosted: Sun Jun 13, 2010 7:00 pm   Post subject: Re: How do I get my program to read text from a datafile?

So basically when you are doing IO in turing the same input rules apply:

Use (1) to get one character input, use * to get the whole line.

Use the following code to run an input stream, make sure the file is in the same folder as your turing file.

Turing:
var input : int
open : input, "DATA.txt", get

var str : string

get : input, str

get : input, str : *

put str
Tony




PostPosted: Sun Jun 13, 2010 7:01 pm   Post subject: RE:How do I get my program to read text from a datafile?

Turing Walkthrough links to appropriate tutorial(s) for reading from a file
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  [ 3 Posts ]
Jump to:   


Style:  
Search: