Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 6th, 2024, 7:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Input Form
PostPosted: October 28th, 2010, 6:27 am 
Offline

Joined: June 2nd, 2010, 11:48 pm
Posts: 10
Opus: Professional v7.01
OS: Windows 7
Hi,

I have been searching the forum for well over an hour now so I'm not sure if this has been covered.

I have a MS Word document that I would like to put into an Opus Pro V7 publication to enable the user to tab from txtInputBox to txtInputBox and enter data. By using OPV7 the user would not be required to have MS Word on their computer.

The first time a user accesses the page where the txtInputBoxes are they will be blank. Once filled in I would like to store the 'values'. The next time the user visits this page the txtInputBoxes would be populated with their previous answers.

I have learnt recently how to use variables and write the value to a txt file in the publication's directory. I have also been successful in retrieving this information.

If I have a couple of paragraphs of text and say 10 txtInputBoxes what would be the best method to store each one and then retrieve the data? Would a variable array do the job and then have the results stored in a txt file or would a database be better suited?

Does anyone have an example project I could review?

Thanks, Andrew


For this message intertag has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: October 28th, 2010, 5:16 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
Andrew,

Do you really need to work with Microsoft Word documents? If so, I cannot help you -- I don't know how to do WHAT I THINK you are asking. It seems you want some kind of a hybrid solution for a Visual Basic form and have it work in Opus? You also leave out key information about what versions of MS Word need to be handled. Generally you would display a Word doc in a DocView object in Opus.

However, if you can work with plain text -- you have many options. Even in the simple Text Object, you can mix static text and text that gets updated when a variable changes. You could have the User write in his text in a Text Input Object -- and you associate an Opus variable with that object... so when the User changes the information it is automatically updated in that first Text Object.

As for other ideas: I suggest you look into INI files as a possible format for storing your User's information. (do a Search on the forum). But even a basic text file is okay too -- Opus has actions which can treat comma-separated data as fields.

You posted in 'Basic' section, so I have to assume you will not use opusscript. Here are a couple links to prior Posts and examples.
viewtopic.php?f=4&t=2688&hilit=user+input
viewtopic.php?f=4&t=3961&hilit=input
The first example/link does use OpusScript so may be of little use to you. However, you can view it as an example pub and see how it is set up.
The second one may not need or use scripting (although it shows part of a script for controlling formatting).

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


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: October 28th, 2010, 7:50 pm 
Offline

Joined: June 2nd, 2010, 11:48 pm
Posts: 10
Opus: Professional v7.01
OS: Windows 7
Hi Lar_123 and thankyou for your reply.

I will have a look at teh examples.

Cheers, Andrew


For this message intertag has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: October 28th, 2010, 11:02 pm 
Offline

Joined: June 2nd, 2010, 11:48 pm
Posts: 10
Opus: Professional v7.01
OS: Windows 7
Hi Lar_123,

I have searched the forum for INI as you suggested yet that is very confusing as I am new to all of this and do not have any experience with any scripting or programming what so ever.

My example would look something like this. Initial values would be blank and then when the user enters each answer into a txtInputBox it would be stored in the publications directory.

Twinkle, twinkle little [star] how I wonder what you are. Up above the [world] so high, like a [diamond] in the sky.

I could create txt files for each answer "star, world & diamond" as I have had success with this yet it is probably the long way to do things.

I will persist in searching the forum and Opus help files yet as always time is limited.

Thanks, Andrew


For this message intertag has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: October 29th, 2010, 7:05 am 
Offline

Joined: June 2nd, 2010, 11:48 pm
Posts: 10
Opus: Professional v7.01
OS: Windows 7
Hi Lar_123,

Okay I think I have worked out this INI file process. I have implemented it and tested and so far it works very nicely, thanks for your help.

Here are the lines of script I am using:

To write to INI file I am using this, I have 11 text input boxes.
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP1", var_txtIP1);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP2", var_txtIP2);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP3", var_txtIP3);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP4", var_txtIP4);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP5", var_txtIP5);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP6", var_txtIP6);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP7", var_txtIP7);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP8", var_txtIP8);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP9", var_txtIP9);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP10", var_txtIP10);
SetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP11", var_txtIP11);

To retrieve the data I am using this.
var_txtIP1=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP1")
var_txtIP2=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP2")
var_txtIP3=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP3")
var_txtIP4=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP4")
var_txtIP5=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP5")
var_txtIP6=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP6")
var_txtIP7=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP7")
var_txtIP8=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP8")
var_txtIP9=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP9")
var_txtIP10=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP10")
var_txtIP11=GetINIFileData(SYSTEM_PUBLICATION_DIR + "TBF.ini", "TBFVP2b", "txtIP11")

Is there an easier way to write these?

Regards, Andrew


For this message intertag has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: October 29th, 2010, 10:28 am 
Offline
Godlike
Godlike
User avatar

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

Anything that requires repetition can normally be automated using loops and arrays.

In your cause, you'd need to use an array instead of the variables and a FOR loop to read and write to the INI. This would mean giving the INI sections a sequential name - the easiest being 1,2,3,4,5 - the same as your loop - but it is possible to concatenate a string and sequential value.

I've got an introduction on arrays.

http://www.live.interaktiv.co.uk/index. ... Itemid=166

Have a play and it if doesn't work out - I'll use your example to write a brief into to looping INIs.

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: Input Form
PostPosted: October 30th, 2010, 6:13 am 
Offline

Joined: June 2nd, 2010, 11:48 pm
Posts: 10
Opus: Professional v7.01
OS: Windows 7
Hi Mack,

Thanks for your suggestions. I think I understand an Array Variable yet as a novice this goes a little beyond what I know.

I'll have a play and see what happens but if you could please write a quick example as you suggested may quicken my learining curve?

Thanks

Andrew


For this message intertag has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: October 30th, 2010, 6:43 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
I,

Remember... this forum is searchable. Lots of previous examples and discussions.

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


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Input Form
PostPosted: November 1st, 2010, 2:13 pm 
Offline
Godlike
Godlike
User avatar

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

Have added a short intro on how to loop through some INI data and populate an array.

http://www.live.interaktiv.co.uk/goto.p ... =scribbles

Hope it points you in the right direction.

Regards,


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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group