Half script good .... why ?

Moderator: Moderator Group

Half script good .... why ?

Postby alverman » Sun Jun 03, 2012 3:23 pm

Two fader layer 1 and 2
one button abort fade with return fade to 0 and 255

Because it works well only if the BtoA?

(A=Fader 1 B=Fader 2)
Script

Code: Select all
if StopFade = 1
{
 WDFaderAbortAllFades
   if AtoB = 1
   {
      WDFaderUp,1,FadeTime
      WDFaderDown,2,FadeTime
   }
   else
   {
   if BtoA = 1
    {
       WDFaderDown,1,FadeTime
       WDFaderUp,2,FadeTime
    }
   }
}
else
{
}
PROService -IT
Intel i7 2600K LGA1155
MB P8H67-MLE 16GB
2xSSD 250GB
GTX470
Win 8.1 PRO
Manager STD V6.1
Player PRO V6.1
WDPro V5 2500
** La famiglia ti nutre, ti veste .... finchè non sei pronto per girare il mondo alla ricerca di qualcosa di tuo. **
User avatar
alverman
 
Posts: 562
Joined: Sat Jun 12, 2010 6:37 pm

Re: Half script good .... why ?

Postby alverman » Sun Jun 03, 2012 9:49 pm

Please note that encapsulated If structures are not possible and will not be supported. :mrgreen:
PROService -IT
Intel i7 2600K LGA1155
MB P8H67-MLE 16GB
2xSSD 250GB
GTX470
Win 8.1 PRO
Manager STD V6.1
Player PRO V6.1
WDPro V5 2500
** La famiglia ti nutre, ti veste .... finchè non sei pronto per girare il mondo alla ricerca di qualcosa di tuo. **
User avatar
alverman
 
Posts: 562
Joined: Sat Jun 12, 2010 6:37 pm

Re: Half script good .... why ?

Postby Markus Zeppenfeld » Mon Jun 04, 2012 9:57 am

Yes man!

This is the reason, indeed. We do not support encapsulated if structures.
Maybe you can split it into the else case or set a variable to check the encapsulated case within in a new if clause.

Markus
Markus Zeppenfeld
Senior Product Manager, Pandoras Box

"Have you tried turning it off and on again?" (from "The IT Crowd" / channel 4)
Markus Zeppenfeld
 
Posts: 824
Joined: Wed Mar 02, 2011 10:12 am
Location: Cologne - Germany

Re: Half script good .... why ?

Postby alverman » Wed Jun 06, 2012 10:27 am

Since you can not use nested if I decided to create two macros that contain if that control the value of a variable, but each seems to work.

I put in the button script:

Code: Select all
if StopFade = 1
{
 WDFaderAbortAllFades
 AtoB_State
 BtoA_State
}


where the macro BtoA_State contains:

Code: Select all
if BtoA = 1
{
  WDCustomScriptSilentClickToggle,4
  WDFaderDown,1,FadeTime
  WDFaderUp,2,FadeTime
}


and the macro AtoB_State contains:

Code: Select all
if AtoB = 1
{
  WDCustomScriptSilentReleaseToggle,4
  WDFaderUp,1,FadeTime
  WDFaderDown,2,FadeTime
}


Thanks, Alberto
PROService -IT
Intel i7 2600K LGA1155
MB P8H67-MLE 16GB
2xSSD 250GB
GTX470
Win 8.1 PRO
Manager STD V6.1
Player PRO V6.1
WDPro V5 2500
** La famiglia ti nutre, ti veste .... finchè non sei pronto per girare il mondo alla ricerca di qualcosa di tuo. **
User avatar
alverman
 
Posts: 562
Joined: Sat Jun 12, 2010 6:37 pm

Re: Half script good .... why ?

Postby alverman » Wed Jun 06, 2012 3:42 pm

Solved :mrgreen:
PROService -IT
Intel i7 2600K LGA1155
MB P8H67-MLE 16GB
2xSSD 250GB
GTX470
Win 8.1 PRO
Manager STD V6.1
Player PRO V6.1
WDPro V5 2500
** La famiglia ti nutre, ti veste .... finchè non sei pronto per girare il mondo alla ricerca di qualcosa di tuo. **
User avatar
alverman
 
Posts: 562
Joined: Sat Jun 12, 2010 6:37 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 35 guests