Odd Syntax Error: "with visual effect"

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gizmoboyGAiiKM
Posts: 20
Joined: Thu Dec 08, 2011 12:20 pm

Odd Syntax Error: "with visual effect"

Post by gizmoboyGAiiKM » Mon Jan 09, 2012 8:15 am

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?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Odd Syntax Error: "with visual effect"

Post by jmburnod » Mon Jan 09, 2012 10:02 am

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
https://alternatic.ch

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Odd Syntax Error: "with visual effect"

Post by Dixie » Mon Jan 09, 2012 12:33 pm

Jean-Marc...

You don't use the quotes...

Code: Select all

visual effect push right
go card  x
should do it

be well

Dixie

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Odd Syntax Error: "with visual effect"

Post by Klaus » Mon Jan 09, 2012 5:25 pm

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

gizmoboyGAiiKM
Posts: 20
Joined: Thu Dec 08, 2011 12:20 pm

Re: Odd Syntax Error: "with visual effect"

Post by gizmoboyGAiiKM » Mon Jan 09, 2012 6:01 pm

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"

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Odd Syntax Error: "with visual effect"

Post by Klaus » Mon Jan 09, 2012 6:19 pm

Hm, that syntax works for me:
LiveCode 5.02, Mac OS X 10.7.2!?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Odd Syntax Error: "with visual effect"

Post by mwieder » Mon Jan 09, 2012 6:31 pm

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.

gizmoboyGAiiKM
Posts: 20
Joined: Thu Dec 08, 2011 12:20 pm

Re: Odd Syntax Error: "with visual effect"

Post by gizmoboyGAiiKM » Mon Jan 09, 2012 7:22 pm

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!

Post Reply