How to start this project...

Mark Schonewille m.schonewille at
Sun Oct 8 10:18:02 EDT 2006


To understand the selectedChunk, put the following script into a field:

on selectionChanged
   put the selectedChunk
end selectionChanged

and select a text in the field, then change a different text. You'll  
see that the selectedChunk is not a text but a reference to that text.

The parameter that goes with the keyDown message contains only one  
character. Your parameter theKey cannot contain "-1", it can only  
contain "-" or "1" or  "+" etc.

I don't think that the keyDown message would be a good way to check  
the contents of fld "insertionField". You might want to use the  
closeField message and the returnInField and enterInField messages  

Probably, you chose a wrong approach. I recommend changing your  
interface. If you want to add a number which is either 0, -1 or +1,  
make a slider or a menu with three options. This way, it is easier to  
make a choice and the user can't make a mistake by entering an  
invalid number.




Consultancy and Software Engineering

Get your store on-line within minutes with Salery Web Store software.  
Download at

Op 6-okt-2006, om 12:48 heeft Adrian Williams het volgende geschreven:

> if the selectedChunk (theKey, field "insertionField") is -1 then
>   answer "endChar is -1"
> else
> if the selectedChunk (theKey, field "insertionField") is +1 then
>     answer "endChar is +1"
>   else
> if the selectedChunk (theKey, field "insertionField") is 0 then
>       beep
>       end if
>   end if
>   end if
> end keyDown
> What am I missing?
> Many thanks,
> Adrian

More information about the use-livecode mailing list