Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 10:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Write to txt file
PostPosted: July 19th, 2011, 9:14 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Hi stil new to opus pro.

now what i am trying to do is when i click on a button the number associated with the button displays in the MainDisplay text box. Got this working and all but now i am trying to get anything that is displayed in the MainDisplay to display in another text box called changeThis. Now i am unsure if you are allowed to use

Display.SetSelection(0,-1);
Display.ReplaceSelection(stringEntered);

twice? Also i tried to write the string that is entered to write to a .txt file. Is this the correct function to do this?

var changeThis = OpenFile("c:\\StrinEnterSave.txt")
changeThis.Write(stringEntered)

thanks :|


Top
 Profile  
 
 Post subject: Re: Write to txt file
PostPosted: July 19th, 2011, 9:29 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Ok so i got it to write the string entered to the txt file but how do i tell it to write an already entred string to the txt file.
U say

textObj.WriteLine("Hello World")

but i want to write the string that is already entered like say for instance on a calculator you pres 558, i want that to write to the txt so to save that value. Is there a way to do this?


Top
 Profile  
 
 Post subject: Re: Write to txt file
PostPosted: July 19th, 2011, 9:50 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
haha ok I got the first post working to! woot!

...anyway i am stil looking for a way to store an already entered string to the text file :roll:

i tried

var textObj = OpenFile("c:\\myText.txt")
textObj.WriteLine("Hello World")

and replaced "Hello World" with the name of the variable, but then it just writes out [FileObject]


Top
 Profile  
 
 Post subject: Re: Write to txt file
PostPosted: July 19th, 2011, 4:47 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It sounds like you're using the name of the actual OBJECT, as seen in the display tree rather than a variable.

If you add a Text Input Box to the screen and then edit its properties, there is a tab called "text input". In here, you specify the variable that will hold the data. This is the value used when writing to disk in place of "hello world".

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: Re: Write to txt file
PostPosted: July 20th, 2011, 9:14 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Youre right. Thank you, got it working now! :)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 23 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