HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... toggle variable value with IF statement
toggle variable value with IF statement
  View type:
I am trying to create a button that toggles the value of a variable and it does not work.

This is what I have in the action's onclick event:

IF(Condition='#ShowCC==0')
MSGBOX(Text="Got Here 1')
VARIABLE(NAME='ShowCC',Value='1',Scope='1')
ELSE
MSGBOX(Text="Got Here 2')
VARIABLE(NAME='ShowCC',Value='0',Scope='1')

Neither message box displays. Still doesn't work when I have the following line of code execute first:
VARIABLE(Name='ShowCC',Value='1',Scope='1')

Thanks,
Kevin
 
Have you outdented the lines in the conditions?
It's an undocumented feature ;)
Scripts will quietly fail if you don't outdent so that it looks like readable basic or html.
 
 
I have the MSGBOX and VARIABLE functions indented but neither conditions execute. When not indented both conditions execute.
 
 
 
Works allright here but not with "Scope=1" but both "Scope='Entire Module" and "Scope='Current Slide'". I would not even know how to enter "Scope=0" [;)]


Subject:
Message options
No additional options