Question on an error

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
matt
Posts: 18
Joined: Sat Jun 12, 2010 2:40 am

Question on an error

Post by matt » Tue Jul 20, 2010 1:34 am

Hi, I'm new with Revolution and have been getting around so far without too much trouble, but I have a strange error which I can't figure out. I'm hoping someone on the forum can provide some insight.
answer the number of words in field "memorizeText" where the textColor is "black"
An answer box pops up with the correct number of works, but then I get the error

Handler: can't find handler.

Thanks for any help you can offer. It just seems odd to me that Revolution understands the request, provides the right response, and then gives this error.

Curry
Posts: 111
Joined: Mon Oct 15, 2007 11:34 pm
Contact:

Re: Question on an error

Post by Curry » Tue Jul 20, 2010 9:57 am

As far as I know, "where" is not a supported keyword. (Think SQL.) It's only an illusion that Rev understands; it's simply acting blindly on the first half of the sentence (before where), returning the total number of words in your field, and then continuing on to choke on the where clause, which is unsupported/unknown syntax.

There are various ways of accomplishing your goal, but one of the simplest and speediest would be (instead) to simply keep track of the number of handled (memorized?) words in a separate variable. When you color a word, increment or decrement the variable as needed.
Best wishes,

Curry Kenworthy

LiveCode Development, Training & Consulting
http://livecodeconsulting.com/

WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Question on an error

Post by FourthWorld » Tue Jul 20, 2010 2:17 pm

Curry wrote:As far as I know, "where" is not a supported keyword.
True, but after reading that I can see it as a useful extension to the language.

Anyone here submit that to the RQCC?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

matt
Posts: 18
Joined: Sat Jun 12, 2010 2:40 am

Re: Question on an error

Post by matt » Tue Jul 20, 2010 8:48 pm

Thanks for your replies. Now I understand I'll rework this using a variable. I guess the syntax coloring the IDE threw me a bit, but it makes sense considering WHERE is used all the time in SQL.

Post Reply