I am storing handle value ( SESSION:FIRST-CHILD ) in a character variable which is 112324 and then again trying to convert this value to handle. but while displaying it is showing zero.
Is it possible to convert handle to character and vice versa ?
Or simply use the correct functions for conversion. You do not mention what you have tried. You can use the HANDLE function to convert the character representation back to a handle. Note that the handle must of course still be valid!
Code:
DEFINE TEMP-TABLE tt
FIELD cc AS CHAR
.
DEF VAR cch AS CHAR.
DEF VAR hh AS HANDLE.
CREATE tt. tt.cc = "hello".
cch = STRING( TEMP-TABLE tt:DEFAULT-BUFFER-HANDLE ).
hh = HANDLE( cch ).
MESSAGE hh::cc VIEW-AS ALERT-BOX.
And which magical feature would you expect that to give you?
I used DEFAULT-BUFFER-HANDLE in my example to illustrate converting a handle to a character and back. If you already have a HANDLE you can simply STRING() this into a character and HANDLE() it back. But as I mentioned with my example, putting a handle in a string (or another handle for that matter) will not prevent the 'copy' of the handle from becoming invalid / reused.
That error suggests that your FIRST-CHILD is a Window, and you are assuming it is a Query.
You could loop thru all the kidlets and check the type until you found a query ... but this whole line of thinking sounds kind of hopeless, to be honest.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.