Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: differences in Pub variables and OpusScript arrays
PostPosted: January 9th, 2005, 10:38 pm 
I am a little confused on the scope of OpusScript variables and Publication variables. Especially the use of arrays.

If I declare a Publication Varaiable Array and wish to process the array elements, let's say add elements, alter elements, ect. in OpusScript, how do I declare that variable in the script?

Also, how can I do math functions to Pub array elements without OpusScript? If that's not possible, how do I do it in OpusScript?

I guess I still need more information on how Publication variables relate to Opus Script variables.

Thank You!


Top
   
 
 Post subject:
PostPosted: January 10th, 2005, 4:54 am 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
If an array has already been declared as a publication variable
then you can alter the individual elements directly in a script like this

let's say you want to set the first element of a array called "MyArray" to 2

-------------------------------------

MyArray[0] = 2

-------------------------------------

If you want to add 2 to the first element of MyArray

-------------------------------------

MyArray[0] = MyArray[0] + 2

-------------------------------------

If you want to get this done without script, it's a little more complicated
if you want to merely set the value of the first element of MyArray to 2 then

Actions dialog >> programming >> variables >> Set Array Variable
Variable = MyArray
Index = 0
Set this variable to the following = Number >> 2.00
Overwrite/Append = Overwrite current contents

If you want to add 2 to the first element of MyArray then you'll need
two actions.

Action1: Actions>>programming>>variables>>Set Variable to Expression
set var1 to expression MyArray[0]+2

Action2: Actions>>programming>>variables>>Set Array Variable
Variable = MyArray
Index = 0
Set this variable to the following = Variable >> var1
Overwrite/Append = Overwrite current contents


HTH
Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 10th, 2005, 11:21 pm 
Beautiful, Chris! That is what I originally thought. Thanks for the reply. It answers a LOT of questions. I have now been successful in manipulating array elements soley in Script. That seems the way to go to iterate through numerous elements with better loop control!

Thnak you!


Top
   
 
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: No registered users and 34 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