'queryregistry(regKey)' causes "Handler: can't find han

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
verlsnake
Posts: 22
Joined: Mon Jan 28, 2008 5:42 pm

'queryregistry(regKey)' causes "Handler: can't find han

Post by verlsnake » Fri Mar 14, 2008 2:48 am

I have created the following button handler code:

Code: Select all

on mouseUp pMouseBtnNo
    put "HKEY_LOCAL_MACHINE\SOFTWARE\KaiSoft" into regKey 
    queryregistry(regKey)
    put queryregistry(regKey) into regValue
    answer regValue
end mouseUp
Running it, causes the following error message:
Type Handler: can't find handler
Object Button
Line queryregistry(regKey)
Hint queryregistry
I have used the smallest example 'queryregistry(regKey)' first because it is along the lines of the dictionary examples; since I have not yet totally foxed myself into RR, I thought 'queryregistry' is really not found/available; and have therefore done considerable research; without success ... By chance I have then added the line with the return value of 'queryregistry' actually put into a variable; and outcommented the "naked" 'queryregistry' invocation. And yes: Now it runs like a charm :-) !

In this case the question seems to be viable: Is this a feature or a bug ? If it is a feature, the error message should be more explanative. If it is a bug, I ask myself if it occurs for other functions/commands/handlers, too ?

P.S.: Where should supposed buggy behaviour be posted to in the RR community ?

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

Post by Klaus » Fri Mar 14, 2008 9:41 am

Tach verlsnake :-)

"queryregistry" is a function, so you have to "get" or "put" the returned value into something!
You used it like a handler and that's why the engine complained!

This should work as exspected:

Code: Select all

on mouseUp pMouseBtnNo 
    put "HKEY_LOCAL_MACHINE\SOFTWARE\KaiSoft" into regKey 
    put queryregistry(regKey) into regValue 
    answer regValue 
end mouseUp
Hope this helps.


Regards und liebe Grüße

Klaus


P.S.
Here is the place to report bugs, you need to sign in however...
http://quality.runrev.com/qacenter/query.cgi

verlsnake
Posts: 22
Joined: Mon Jan 28, 2008 5:42 pm

Post by verlsnake » Fri Mar 14, 2008 8:33 pm

Ebenfalls Tach auch, Klaus(i) :-) !

In this case let me say in German:

Danke und bis zum nächsten Thread 8)

Kai

Post Reply