Page 1 of 1

Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 8:15 am
by gizmoboyGAiiKM
Hi all,

Just getting started with LiveCode, messing around with some IOS samples.

I'm getting an error I don't understand when trying to set up a handler to move to another card. When I try to compile this script:

Code: Select all

on cancelEdit
   go to card "Classes" with visual effect push right
end cancelEdit
I get an error:

card "thisCard": compilation error at line 12 (Expression: unquoted literal), char 30

Line 12 in they case is the "go to card" line.

That syntax comes more or less straight out of the docs. What am I missing?

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 10:02 am
by jmburnod
Hi gizmoboyGAiiKM,

I think you fprget quote before Push and after right

Code: Select all

on cancelEdit
   go to card "Classes" with visual effect "push right"
end cancelEdit
Best regards

Jean-Marc

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 12:33 pm
by Dixie
Jean-Marc...

You don't use the quotes...

Code: Select all

visual effect push right
go card  x
should do it

be well

Dixie

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 5:25 pm
by Klaus
Hi firends,

wrong snytax! 8)

Code: Select all

on mouseup
   visual push right
   go card "Classes"
end mouseUp
"with visual..." is for showing/hiding objects

Code: Select all

on mosueup
    hide fld 1 with visual push right
end mouseup
Or maybe we all should get used to the new syntax introduced in LC 5x :D

Code: Select all

on mouseup
   lock screen for visual effect
   go cd "classes"
   unlock screen with visual wipe right fast
end mouseup
Best

Klaus

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 6:01 pm
by gizmoboyGAiiKM
Klaus wrote:Or maybe we all should get used to the new syntax introduced in LC 5x :D

Code: Select all

on mouseup
   lock screen for visual effect
   go cd "classes"
   unlock screen with visual wipe right fast
end mouseup
Best

Klaus
Thanks for the help, Klaus. However, this code:

Code: Select all

on editClasses
   lock screen for visual effect
   go to card "EditClasses"
   unlock screen with visual wipe right fast
end editClasses
still yields the error:

card "Classes": compilation error at line 22 (expression: unquoted literal at char 30)

Line 22 is "unlock screen with visual wipe fast right"

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 6:19 pm
by Klaus
Hm, that syntax works for me:
LiveCode 5.02, Mac OS X 10.7.2!?

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 6:31 pm
by mwieder
Klaus-

With explicitVars disabled you can get by without the quotes, so it works for you.

gizmoboyGAiiKM-

Do one of these two things:

1. Put quotes around your string literals

Code: Select all

unlock screen with visual wipe "right fast"
2. Go into LiveCode's preferences and uncheck "strict compilation" under Script Editor settings.

Re: Odd Syntax Error: "with visual effect"

Posted: Mon Jan 09, 2012 7:22 pm
by gizmoboyGAiiKM
mwieder wrote:gizmoboyGAiiKM-

Do one of these two things:

1. Put quotes around your string literals

Code: Select all

unlock screen with visual wipe "right fast"
That did it -- thanks!