PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Class object not returning string values
Class object not returning string values
Débuté par Prolay Sarkar, 02 jan. 2009 11:28 - 3 réponses
Posté le 02 janvier 2009 - 11:28
Hi,
I have a class made from a query and in a global function i am returning the object of the class. But at the calling end i am not able to get the value of string member.
CLASS
----------
CQRY_Lookup_City is class
PUBLIC
lookup_id is int
lookup_name is string
END
GLOBAL FUNCTION
------------------------------
FUNCTION New_Global_Proc()
HExecuteQuery(QRY_Lookup_State,hQueryDefault,"100001")
HReadFirst(QRY_Lookup_State)
IF HFound()=True THEN
ab is CQRY_Lookup_City
FileToMemory(ab,QRY_Lookup_State)
RETURN = ab
END
END
CALLING END
-------------------
abc is CQRY_Lookup_City
abc=New_Global_Proc()

OBJECT VALUE AT FUNCTION LEVEL (ab:)
---------------------------------------
lookup_id =1
lookup_name = "ABCD"

OBJECT VALUE AT CALLING SIDE (abc:)
---------------------------------------
lookup_id =1
lookup_name = ""
Posté le 02 janvier 2009 - 14:18
hi,
I tried Serializing/Deserializing the object and i was able to get the values.
Anyone with a better solution?
Regards
Prolay
Posté le 03 janvier 2009 - 11:42
Hi Prolay,
FUNCTION New_Global_Proc() contains at least one bug.
REPLACE "RETURN = ab" ab with "RESULT ab".

The RETURN keyword has a different meaning: See Online Help:
beside; the second "END" is not nessesary
Regarding your 3 tier request... See Online Help RPC
HTH Bjoern
Posté le 05 janvier 2009 - 08:09
Hi Prolay,

>FUNCTION New_Global_Proc() contains at least one bug.



>Replace "RETURN = ab" with "RESULT ab".



>

The RETURN keyword has a different meaning: See Online Help:


>beside; the second "END" is not nessesary



>Regarding your 3 tier request... Search Online Help for RPC



>HTH Bjoern



>



>

Edited 1 times. Last edit at 01/03/09 07:50AM by BLS.

Hi,
I tried with RESULT ab , but still not working basically i tried RESULT first and then i tried RETURN.
Does windev support remote object invocation as supported by .NET remoting framework?
Regards,
Prolay