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

Username:   Password: 
 RegisterRegister   
 Turing data file help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
l3`




PostPosted: Thu May 21, 2015 5:48 pm   Post subject: Turing data file help

What is it you are trying to achieve?
Im trying to pull text from certain places in a data file and output to run window. No sucess so far.

What is the problem you are having?
Not sure how to pull certain pieces of data. (i.e, from line 2, spaces 5..100)

Describe what you have tried to solve this problem
ive looked at a bunch of tutorials, but so far none have helped. Ive tried the basic code which is whats below, but it runs and nothing happens..


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)



Turing:


var questions : int
var line_num : string := ""
open : questions, "Questions", get
loop
    exit when eof (questions)
    get : questions, line_num : 25
end loop
close : questions




Please specify what version of Turing you are using
Turing for Windows
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Thu May 21, 2015 7:17 pm   Post subject: RE:Turing data file help

You can use the seek (or is it read?) function, but it's probably easier to just get input until you get to the one you need. If you need line 5, get the first 4 lines (you can put them all in the same variable, since you don't care about them), then get the 5th. There's nothing wrong with reading extra data until you get into very large data sets.
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: