Page 1 of 1

I would like to ask about Transient object.

Posted: Fri Aug 07, 2009 2:49 pm
by ConvertFromOldNGs
by m&m >> Sat, 31 Jan 2004 19:59:35 GMT

Hi guys, I just start learning Jade . I got stuck when try to access Transient object. suppoase I create class named "tempValue"(public-real-transient) which has 2 attributes named "valX" and "valY" both are String.

begin
vars
crtempValue : tempValue;
create addJovcUser transient;
crtempValue .valX :="1";
crtempValue .valY :="5";
write ( crtempValue.valX & crtempValue.valY);
end;

I would like to how can I retrive the data stored in crtempValue.valX and crtempValue.valY ..

Re: I would like to ask about Transient object.

Posted: Fri Aug 07, 2009 2:49 pm
by ConvertFromOldNGs
by dcooper@jade.co.nz >> Sun, 1 Feb 2004 20:53:29 GMT

The code as you've posted it won't compile. If you have your TempValue class (all classes in JADE start with a capital letter), your code needs to look something like:

vars
crtempValue : TempValue;begin

create crtempValue transient;
crtempValue.valX :="1";
crtempValue.valY :="5";
write crtempValue.valX & crtempValue.valY;
epilog
delete crtempValue;
end;

The epilog isn't strictly necessary (eg: you may want to assign crtempValue to a reference somewhere to use the object later), but in the example above you probably want to delete crtempValue once you've finished with it and epilogs are a good place to do stuff like that.

Dean.