Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Reading a file from a listbox selection
PostPosted: November 19th, 2009, 12:37 am 
Offline

Joined: November 3rd, 2004, 6:44 pm
Posts: 59
Location: Ipswich, UK
I am working on a proof of concept version of a game in which you can select a topic from a listbox (the list would be read in from a textfile in the final version). The choice in the listbox would then load up a series of questions (which eventually would be randomised) into an array so they could be displayed appropriately.

As you will see in the example the listbox works fine and the script to load the questions appears to work as it loops through and finds the correct number of questions in the text files but the actual questions do not get read into the array question[].

Anyone have any idea why this does not work/how I can get it to work as I would like to use it as a basis for selecting a series of childrens word games in the future.

Opus Pro 6

Regards

Clive Cartmel


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

_________________
Opus Headstart Pro 6
Opus Pro 6


For this message Clive Cartmel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 19th, 2009, 1:38 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You need to add the variable 'Question' (type Array) to either the page or publication.


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: File from listbox
PostPosted: November 19th, 2009, 12:38 pm 
Offline

Joined: November 3rd, 2004, 6:44 pm
Posts: 59
Location: Ipswich, UK
First of all thank you - saved by the Mac again!

Ever so slightly embarassed, but also rather confused.

If you look at the att. imp I have hard coded the file name that needs to be loaded up rather than being selected by the listbox.

I have not set a publication or page array for 'Question' but it works perfectly. Why does it work here and not with the other example?

I always work from an example I can understand and then develop it further as necessary. In this case the logic seems to have changed going from one method to the next.

Thanks once again

Clive


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

_________________
Opus Headstart Pro 6
Opus Pro 6


For this message Clive Cartmel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 19th, 2009, 12:54 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You called the function ReadQuestions() on page show in the last example which defines the variable but not on the original posted.

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  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

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