Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 15th, 2024, 11:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Scripting issue
PostPosted: June 27th, 2006, 4:16 pm 
Offline

Joined: November 3rd, 2004, 4:12 pm
Posts: 173
Location: UK
I’m trying to figure out the best way to achieve the following, and would welcome advice:

I am building a publication with 14 pages. On each page, there are a number of statements. For example …

Page 1

My name is Roger
My name is Helen
My name is Charlie
My name is Valerie

Page 2

I have red hair
I have black hair
I have grey hair
I am bald

Page 3

I like chocolate
I like apples
I like milkshakes
I like bananas

Whichever statement is clicked should contribute to a final summary page – e.g. My name is Charlie – I have red hair – I like bananas.

Each statement has a unique name so, rather than making hundreds of summary pages reflecting the myriad pathways that could be followed, I’m aiming to write a simple script that will do the business.

As I say, I’m trying to figure it out but any advice would be most welcome.

Roger


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 27th, 2006, 4:58 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
You don't need to script this - a few variables are all you need.

Create a variable for each question
Code:
qName
qHair
...

etc. Assign a value (on paper somewhere) to each answer:
Code:
Roger = 0
Helen = 1
Charlie = 2
Valerie = 3

red hair = 0
black hair = 1
grey hair = 2
bald  = 3

Add an action to each choice that sets the variable to that value when the user selects it:
Code:
On Left Click Set qName = 0;
On Left Click Set qName = 1;
...

On your summary page have a series of Select statements to build your output string:
Code:
Set "Out" to "My name is"

Select (qName)
Case 0: Set "Out" to "Roger" (append contents)
Case 1: Set "Out" to "Helen" (append contents)
Case 2: Set "Out" to "Charlie" (append contents)
Case 3: Set "Out" to "Valerie" (append contents)

Set "Out" to ". I " (append contents)

Select (qHair)
Case 0: Set "Out" to "have red hair" (append contents)
Case 1: Set "Out" to "have black hair" (append contents)
Case 2: Set "Out" to "have grey" (append contents)
Case 3: Set "Out" to "am bald" (append contents)

...etc...

Of course you can do the same thing using script if you want but it's not necessary.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 27th, 2006, 5:11 pm 
Offline

Joined: November 3rd, 2004, 4:12 pm
Posts: 173
Location: UK
Thanks, Duncan. I was feeling my way towards something like your suggestion, but would undoubtedly have spent many more hours going round in circles without your signpost.

Regards

Roger


Top
 Profile Visit website  
 
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: Google [Bot] and 9 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