Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: How to continue User Text Input after exiting/relaunch Pub
PostPosted: May 23rd, 2007, 5:40 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Is there a way to set up User Text Input boxes, so that user can return after exiting the Pub and "Append" or "Edit over" previously entered text?

I can see how to display user input in standard text boxes by reading from external file. But how does user change or edit his previous responses, if he exits and returns later?

Any help appreciated.

I'm attaching an Opus file... but there's really not much there.


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 23rd, 2007, 7:48 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lar,

There are several methods for doing this, all involving the storage of the variable value from the text box in one way or another. Depending on the purpose and quantity of text to be stored, you can either write to the registry, a text file or an ini file.

1. The first is practical for configuration values or things like a user name / password.

2. The second is more suited to large blocks of text and needs to be read sequentially.

3. The last, I find, is a combination of the above two. It's kind of like have a snapshot of a record in a database, as the Section Headers allow you to quickly find information that you require. Opus VI includes the ability to write to INI, but I've never used this function - yet!

I DL the IMP and see if anything else comes to mind.

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: May 23rd, 2007, 10:58 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lar,

After DL the IMP, I see that you're already using the text file route. I've modified the publication to use a script to read and write your data. It's saved from Opus VI, so I hope it loads OK. If not, here is the script:

Code:
function theReadFile()
{
  var objTextFile = OpenFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt")
  userINPUT1 = objTextFile.ReadLine()
  userINPUT2 = objTextFile.ReadLine()
  userINPUT3 = objTextFile.ReadLine()
  objTextFile.Close()
}

function theWriteFile()
{
  var objTextFile = OpenFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt",true, false)
  objTextFile.WriteLine(userINPUT1)
  objTextFile.WriteLine(userINPUT2)
  objTextFile.WriteLine(userINPUT3)
  objTextFile.Close()
  LaunchFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt")
}

Call theReadFile function from a PAGE ONLOAD and call theWriteFile from the button click.

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: May 24th, 2007, 8:04 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Mac, Thanks.

I'll be back on this in next couple days.
Thanks for taking time to look at the mock-up. I think what you're suggesting is that the script handling of the situation will "fill" the Text Input Object and make it editable... with a subsequent write action via a commit button.

I will play with this in v5.5. (want to complete some of this development before I change horses.) BTW, I didn't see a modified .imp -- so will go with the script you posted.

Lar

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 24th, 2007, 12:07 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Kooky,

Could have sworn that I'd uploaded it. Anyway, here is is again.


You do not have the required permissions to view the files attached to this post.

_________________
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: May 25th, 2007, 12:58 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Mac,

Thanks tons. I was at a loss for how to approach that.

It works in principle. Now I will need to refine how the script reads-in from the file. For example on first launch, user types in Line 1, line 2, line 3 into the 1st Input Box, ...and then more multline input into Box2, etc. Then after exit and relaunch, the script is reading back in Line 1 to Box1, and line 2 to box 2. So it's just a matter of working out the boundary issue now.

BTW, if any others are following this now... the Page 2 can be disregarded or deleted.

Thanks for the headstart.
Larry

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Update - progress.
PostPosted: May 25th, 2007, 1:38 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Mac,

What I thought might be "a little work" to get the Pub to reload proper lines in respective User Input Boxes turned out to be no effort at all. Thanks again for your pointing the way.

I simply modified the Script 3 object, replacing WriteLine() with WriteField(). And replace ReadFile() with ReadField(). [I take it this accomplishes in script what Opus action dialogues do with the Checkbox options for newline, quotemarks, etc.]

Here is the changed script 3 for the above .IMP file.

Code:
function theWriteFile()
{
  var objTextFile = OpenFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt",true, false)
  objTextFile.WriteField(userINPUT1)
  objTextFile.WriteField(userINPUT2)
  objTextFile.WriteField(userINPUT3)
  objTextFile.Close()
  LaunchFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt")
}

function theReadFile()
{
  var objTextFile = OpenFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt")
  userINPUT1 = objTextFile.ReadField()
  userINPUT2 = objTextFile.ReadField()
  userINPUT3 = objTextFile.ReadField()
  objTextFile.Close()
}

Works perfectly! Mission accomplished.

Lar

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Oops. Still one issue.
PostPosted: May 25th, 2007, 2:37 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
The text Pub works fine with one exception.

If the User 'skips' inputting a response to TextInput1, the Read-in process on relaunch is incorrect. The NULL value in one TextInput box seems to throw off the series.

Any suggestions to avoid a null input, or to force a default blank space?

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 25th, 2007, 5:26 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Lar
Try this script with some modification

Code:
function theWriteFile()
{
  if (userINPUT1=="")
  {
    userINPUT1=" "
  }
  if (userINPUT2=="")
  {
    userINPUT2=" "
  }
  if (userINPUT3=="")
  {
    userINPUT3=" "
  }

  var objTextFile = OpenFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt",true, false)
  objTextFile.WriteField(userINPUT1)
  objTextFile.WriteField(userINPUT2)
  objTextFile.WriteField(userINPUT3)
  objTextFile.Close()
  LaunchFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt")
}

function theReadFile()
{
  var objTextFile = OpenFile(SYSTEM_TEMP_DIR+"myUserTextInputFile.txt")
  userINPUT1 = objTextFile.ReadField()
  userINPUT2 = objTextFile.ReadField()
  userINPUT3 = objTextFile.ReadField()
  objTextFile.Close()
}


For this message opuslover has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 29th, 2007, 5:35 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
O,
That does it. Thanks. Now what else can I get into? :idea:

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

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