Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently September 29th, 2024, 7:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Newbie Qs using variables
PostPosted: September 14th, 2011, 10:30 pm 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
Hi all ( it's been a few years since I used Opus..; Vs 2.6!) just upgraded to latest Pro vs and ready to develop something again..

I have alway struggled with variables .. more likely, using the stored information how i want to. I can't get to grips with the idea of having to iniatiate a variables operation.. (you always had to assign an event' click left mouse button whereas I just want my calculation of couple of variables and the answer variable displayed, to change in real time.

I have a simple excel sheet (from which i want to translate into a user interactive application, in Opus) with say max of 6 cells.. a couple of formulas in three of them. i can change the information that changes in two of them and they instantly change the result withhout my telling it to do so.. is this possible or do I have to assign a trigger like mouse over or something like that?

I'm willing to learn from a book if it helps me in the future. i can't keep asking for asnwers here all the time; it will get on the members nerves


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 15th, 2011, 8:55 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Alan,

You can make all sorts of things happen without having to use Opus Tiggers. However, I think if you're simulating a spreadsheet that you probably want to look at Constant Expressions.

In a text box, when you right click and insert the variable, you have the option to use a constant expression. This allow you to manipulate variables and display the result in real time.

I'm attaching a simple example.

As for books, Opus Script is based on a language that underpins several other scripting languages and the basics can probably be understood from getting an old JavaScript book. Be warned - you'll probably only make use of about 5-10% of the book though as it'll quickly relate to environment of the browser rather than the Opus publication. The reason for an older book is that JS has been updated and some bits won't match!

Also read the Opus Script manual for specific examples and checkout our scribbles: http://www.live.interaktiv.co.uk/index. ... mitstart=5

Lastly, questions are fine. You've already posted a clear profile and the folks here have no objection to answering clear, focused questions.

Mack


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

_________________
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 : Alan Brown


Top
 Profile Visit website  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 15th, 2011, 4:18 pm 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
Hi..

thanks for the imp file. I can see how your example works (and in real time as you have shown) but i can't see how to get the script into the input cell, as you have shown.

I can see script in the programming options but selecting it, brings up the ' you need a trigger' beforehand, message.

I must be thick!


your help is aprpeciated..:)

A programmer deserves a medal, I say (do you sleep at night).. i didn't :cry:


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 16th, 2011, 8:48 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Alan,

There are no scripts.

The input cells are just text boxes but in the properties box (right click on TB) there is a text input tab and then an option to allow user to enter data.

I've simply created a variable for this box. These variables are then used in the constant expression in the last cell at the bottom of the column.

Hope that helps. If not, I'll post some screens.

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: Newbie Qs using variables
PostPosted: September 16th, 2011, 10:58 am 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
Thanks for that.. though I can't see that option.

When I Right Click the TB i get this: attached


Sorry about this..


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


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 16th, 2011, 11:15 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Half way there!

Go to the properties at the bottom and you'll see the attached dialogue box.

Mack


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

_________________
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: Newbie Qs using variables
PostPosted: September 16th, 2011, 11:25 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Mackavi wrote:
Quote:
but in the properties box
So, with the Text Box object or Text Input object selected, type Ctrl-R. (or Right Click, and select "Properties") [Edit: I see Mack's replied... I'll leave this anyway]

Alan,
For some of the basic steps to working in OpusPro, check the Help Files... e.g., Introducing Triggers (your earlier question). Help files have a few topics titled "Getting Started with..." or "Introducing...". It may still be confusing, there is so much to take in. I do encourage you to ask questions here, even the most basic. However, sometimes you can avoid a long wait for an answer and keep up your momentum with a little info from the help files.

I recall being a beginner, and some things made sense right away. Other things took awhile to sink in. I'm still experiencing a few "aha moments" these days.

Cheers.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : Alan Brown, mackavi


Top
 Profile  
 
 Post subject: Mackavi and lar_123
PostPosted: September 16th, 2011, 2:16 pm 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
thank you both..

I'm encouraged to press on... my little 6 cell spreadsheet (whih does exactly what I want) seems such a simple thing but I'm determined to get a grip on it.. someone could do it for me in 5 mins I'm sure and it would probably be a lot more elegant, progamming wise, than my effort is going to be... but I want to learn.


your help is appreciated.

I have seen Text Input, off the properties menu before but thought it would just put in some text; a label perhaps. :oops:



what a donut!


I have been trawling the internet for javascript for dummies.. along with the forum I'm hoping to get something up and running.


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 23rd, 2011, 10:30 am 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
Hi all

I'm going to need some serious handholding here :(


I can work out how the spressheet example works (i have even messed with the type of calculation to see if it does what I think it does and it does do difeerent calculations as expected) However I can't seem to be able to put my own expressions/calculations in my own text boxes. It Mack's ssheet ilm the text is red in the text box but doesn't display when run. Mine just displays the text and does nothing :(

I can't seem to figure how to put these expressions in my Opus ilm.


I have attached the minimalist spreadsheet I want to imitate in Opus. It just let you calculate a new width but keeping the ratio of the original..

(meerkat) Simples.. not :(


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 23rd, 2011, 5:56 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
No attachment :-?

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 : Alan Brown


Top
 Profile Visit website  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 23rd, 2011, 7:34 pm 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
just found out that the extension xls is not allowed...

this is just a 'snip' of the cells.. the red cell just hold the ratio between the width and height relative to eachother.

when you put a 'new' width required in the C15 or new height in C16.. it calculates the proportional size keeping the its perspective intact..

it don't think it's going to help anyone much.. the two Red cells (i want hidden) are simple division formulae.


Thanks for any help..


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


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 30th, 2011, 2:24 pm 
Offline

Joined: May 24th, 2007, 11:02 am
Posts: 132
Location: UK - Wales - Ceredigion
Opus: illuminatus > Evolution
OS: Windows 10 Pro
System: i7 8GB RAM
I just had a quick read through, so sorry if this doesn't help, but...
If you right-click into a text box object and select 'insert variable' then select 'constant Expression' you should see how the above example was done. I think you have just typed the calculation in as plain text?


For this message jezjones29 has been thanked by : Alan Brown, mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 30th, 2011, 2:52 pm 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
You're probably right..!

thanks for the reply.. I'll try what you said.. I feel a right dork!




'if at first you don't succeed... remove all evidence that you tried'


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: September 30th, 2011, 4:51 pm 
Offline

Joined: September 14th, 2011, 9:18 pm
Posts: 9
Opus: Pro 7.
OS: Win 7 Pro 64bit
System: E8600 Core 2 Duo 6Gb Ram 2Tb HD
I'm getting there. .thanks for the Step by step guide..:)

What I'm struggling with now, is getting the figure generated by the constant expression in Text 15 and Text 18 to use as variables for the new calculation.. which is simply A3 x the result of the expression in Text 15 or 18 depending whether the user states a new height or new width based on the ratio of the original.

Suonds complex but it's a simple ratioto work with..


I'm stuck...Help, please.


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


For this message Alan Brown has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Newbie Qs using variables
PostPosted: October 1st, 2011, 9:23 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Whilst I'm sure that it possible - isn't this just maths rather than programming?

If A + B = C and D = C * 3

The D = (A + B) * C

Therefore not requiring C to be defined as a variable at the second step because D can be calculated from the initial input variables?

If things are more complex and you do need C as variable and need to perform an operation when C changes look at Triggers > Advanced > Variable Change for a simple solution.

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  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

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