You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

1

Saturday, September 11th 2010, 5:13pm

break an action

Is there any break command? I couldn't find it in the docs. If something like this would be possible, it would reduce the number of actions I need:

Source code

1
2
3
4
5
<action name="myaction">
   (do stuff)
    if (this == that, break);
   (otherwise do more stuff)
</action>
- Ronny D'Hoore

2

Saturday, September 11th 2010, 8:04pm

http://krpano.com/docu/wiki/index.php/Actions_and_scripting

breakall
Flow control Breaks out of all currently running actions
stopall
Flow control Breaks out of all current actions and clears the queue of waiting actions

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

3

Sunday, September 12th 2010, 8:47am

Sure, that's right, but I don't want to break all currently running actions, but only the one in which my (desired) break command is...
- Ronny D'Hoore

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Sunday, September 12th 2010, 1:01pm

Hi Ronny,

As I know, there is no break() action available...
But I think you can reach similar action using an if() action:

Source code

1
2
3
4
5
6
7
8
<action name="myaction">
   (do stuff)
	if (this == that,
		<!-- pseudo_break --> (do nothing);
		, <!-- else -->
		(otherwise do more stuff);
		);   
</action>



Hi Protected ;-) ,

The definition for breakall() and stopall() ...

Quoted

stop / stopall()

- stops/breaks all current running actions/timersets/tweens
- removes the rest of the queued actions


breakall()
- stops/breaks all current running actions/timersets/tweens
- continues with the rest of the queued actions
Hope this help...

SAlut.

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

5

Monday, September 13th 2010, 7:26am

Thanks, Michel, but the disadvantage of "if" is that you can't nest them. And rarely my actions are that simple that they contain only one "if"... *unsure*

So, now I think we desire two things:
  1. a "break" statement *cool*
  2. and nested if's *tongue*
- Ronny D'Hoore

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

6

Monday, September 13th 2010, 7:33am

Hmm, I just saw in your reply to this question that you do use nested if's, apparently quite happily and successfully. *attention*

I wonder what I did wrong when I was trying this yesterday, and figured it didn't work. Will have to try again...
- Ronny D'Hoore

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

7

Monday, September 13th 2010, 7:39am

Hi Ronny,

Nested IF are possible ;-) ...
Look here for an example: How do I hide all plugins but one?

edited: just see that you allready see it *g* *g* *smile* ...

SAlut

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

8

Monday, September 13th 2010, 7:48am

YES!!!!! *w00t*

I just tested it, and even though I needed to make 20 corrections before I got it right (missing comma's or semicolons, parentheses in the wrong place, you name it). I'm so used to typing C# that whenever I type a condition, I fully automatically type a ) after it, and needless to say, one should not do that here... ;-)

Anyway, in the end I got it right and it works!

Now a whole new world is opening for my scripts... *thumbsup*
- Ronny D'Hoore