Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Array random text display
PostPosted: November 21st, 2012, 12:48 pm 
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)
Hello, it's been a while since i played on Opus now. So what I'm trying to do:

Each time I land on a page, I want a random paragraph of text to display which I created with an array:

Set Array Variable[0] = "My text 1"
Set Array Variable[1] = "My text 2"
Set Array Variable[2] = "My text 3"
...and so on.

and on my page I have:

On Show:
Set <randomtext> to random (Max 3)


Then
I added my text box in which I inserted a constant expression variable:

Constant Expression
My text [0]


But now the problem is that each time the page opens, it only shows "My text 1" index and never the others. Any ideas?
:(


For this message Animellarx has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Array random text display
PostPosted: November 21st, 2012, 1:22 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Not sure I follow your actions but, the last statement...

My text [0]

...is simply reading the value from the 1st array element each time - so no won't change. You'd have to place a random number inside the square brackets to retrieve a random array element.

If that doesn't work, try posting an example that we can look at.

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


For this message mackavi has been thanked by : Animellarx


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

All times are UTC [ DST ]


Who is online

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