Question on Dynamic Conversion of Class Type
Posted: Fri Aug 07, 2009 11:58 am
by Bizpoint >> Wed, 3 Jan 2001 19:40:40 GMT
Hi Jade Developers,
Got a questions that need advise from you all.
1)
The following codes allow the item instance to BankCd.code or User.staffID
Eg:
vars
item : Object ;
begin
if item.isKindOf('BankCd') then
write item.BankCd.code ; // where BankCd is a class
elseif item.isKindOf('User') then
write item.UserCd.code ; // where User is a class
endif;
end;
Is there anyway to pass in the class name dynamically and achieve the following result. Does Jade have the syntax to achieve the following result to reduce coding when there are a lot of code classes.
zPrintCode(dynamicClass : String);
vars
item : Object;begin
write item.dynamicClass.code;
// ^^^^^^^^^^
// is the passed in class name.
end;
Hi Jade Developers,
Got a questions that need advise from you all.
1)
The following codes allow the item instance to BankCd.code or User.staffID
Eg:
vars
item : Object ;
begin
if item.isKindOf('BankCd') then
write item.BankCd.code ; // where BankCd is a class
elseif item.isKindOf('User') then
write item.UserCd.code ; // where User is a class
endif;
end;
Is there anyway to pass in the class name dynamically and achieve the following result. Does Jade have the syntax to achieve the following result to reduce coding when there are a lot of code classes.
zPrintCode(dynamicClass : String);
vars
item : Object;begin
write item.dynamicClass.code;
// ^^^^^^^^^^
// is the passed in class name.
end;