Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 9:05 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: readline FileObject to string
PostPosted: February 23rd, 2009, 6:56 am 
Offline

Joined: March 4th, 2008, 6:49 pm
Posts: 11
Hello, I am trying to read a string in from a file and display it on a page variable. Unfortunately, it only shows up as a FileObject. I tried to use a toString() to cast it to text, but I still get "FileObject" when I try to display the "anotherpage" variable below. Can an anyone tell me what I'm doing wrong?

Code:

var textObj = OpenFile("pagename.txt")
textObj.ReadLine(false)


anotherpage = textObj.toString()

_________________
Development Platform Info:
License A-Opus Pro 6/WinXP SP2 Pentium D 3.39GHz 2GB
License B-Opus Creator 6/WinXP SP2 Core2 Duo 2.4GHz 2GB


Top
 Profile  
 
 Post subject:
PostPosted: February 23rd, 2009, 8:27 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You need to read the contents of the file into a variable and display that on screen.


var textObj = OpenFile("pagename.txt")
myString = textObj.ReadLine(false)

//then display the myString variable on screen in your textbox.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 23rd, 2009, 2:43 pm 
Offline

Joined: March 4th, 2008, 6:49 pm
Posts: 11
{slaps self on forehead}

Thank you very much. I was at the point where I really needed another pair of eyes. I was too close to see that the readline was going nowhere!

Again, thanks a million!

_________________
Development Platform Info:
License A-Opus Pro 6/WinXP SP2 Pentium D 3.39GHz 2GB
License B-Opus Creator 6/WinXP SP2 Core2 Duo 2.4GHz 2GB


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group