Re: How to define a record like another record
Posted in 1995
Succinctly, No. That is, in plain 4GL, there is no method of defining one record type like another type. NewEra does allow you to define record (object) types much more generally, and therefore, two records can both be defined to be of the same (user-defined) type. However, in I4GL, you can define a VIEW with no data in it which would act like a record structure and could be used in the RECORD LIKE viewname.* notation for both variables. This works, but it is not very elegant. Or you can create empty tables, but I don't like those either. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }Date: Fri, 17 Feb 1995 11:02:51 -0500 }From: Min Qiu <min@sura.net> }X-Informix-List-Id: <list.5591> } }I had a record in 4gl(Informix 4.1) which defined as: }DEFINE a_record RECORD c1 int, c2..., cn char(10) END RECORD, } }and I would like be able to define a local variable which had }the same struction as a_record: } }FUNCTION fun() } }DEFINE l_record LIKE a_record.*, -- something like this. }.... -- I don,t want to redefine } -- the some structure again. }END FUNCTION } }Can I do that? How? Thanks for the advise in advance!