Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 7:44 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Setting multiple variables
PostPosted: June 15th, 2020, 11:54 am 
Offline

Joined: August 23rd, 2011, 11:36 am
Posts: 10
Hi
I'm trying to set a load (up to about 500!) of variables to the same (another single variable) in the edit actions tab.
I've tried shift click and control click on the variables list to select them and tried clicking 'x=? Set Variable' action but it only lets you do one at a time.
VERY tedious...any ideas for a quicker way?


Top
 Profile  
 
 Post subject: Re: Setting multiple variables
PostPosted: June 18th, 2020, 10:49 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
If you actually need 500ish variables to use on a page then it may be possible - if not you should consider using an array or script variables for anything not displayed or combination of.

The solution that might work is to create a couple of variables and export them. Edit that file with a text (like notepad) or code editor and then you can create them much faster. Save and import back into Opus.

</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: Setting multiple variables
PostPosted: June 18th, 2020, 2:02 pm 
Offline

Joined: August 23rd, 2011, 11:36 am
Posts: 10
[quote=
The solution that might work is to create a couple of variables and export them. Edit that file with a text (like notepad) or code editor and then you can create them much faster. Save and import back into Opus.
</mack>[/quote]

That's the method I used to initially create the variables and works a treat.

What I've now got is a 'template' project that I use for any new projects (It's an apartment finder system linked to a scale model)
So on every new project I do, every page (and there could be upto 150 or more) will have about 30 variables in the action panel that I need to set to the same other variable.
I was hoping that I could 'control click' on the x=? Set Variable to select them, and set them all at once but 'control click' does not work.

Is it possible to have one array variable that contains several normal variables and be able to change them all at once?

I'm useless at scripting!


Top
 Profile  
 
 Post subject: Re: Setting multiple variables
PostPosted: June 18th, 2020, 9:20 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
If I understand correctly, then the answer is no. Simplifying it, the array stores values not variables. You use one array variable in place of lots of individual repetitive variables.

If they must be individual variables , and Objects are outside of the scope of your programming, then some ideas are:

1. assign them as a single line - a = b = c = d = 27

2. If the variable names follow an incrementing pattern A1, A2, A3, A4, A5 - it may be possible to use 'eval' with a loop

3. If the names are unique, then you could store the variable names in an array and again use eval to set the variables by looping the array.

</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 15 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