Path: news.cs.au.dk!not-for-mail From: "Jorgen Lindskov Knudsen" Newsgroups: comp.lang.beta Subject: Re: Using persistent stores and Arraycontainer Date: Mon, 1 Feb 1999 00:22:51 +0100 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 78 Message-ID: <792ojt$ed3$1@xinwen.cs.au.dk> References: <36B1F583.10425635@stofanet.dk> NNTP-Posting-Host: isdn-002.daimi.aau.dk X-Trace: xinwen.cs.au.dk 917824957 14755 255.255.255.255 (31 Jan 1999 23:22:37 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 31 Jan 1999 23:22:37 GMT X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Xref: news.cs.au.dk comp.lang.beta:11807 Your problem is, that you are saving an object which in its transitive closure has the entire program. You have not followed the advises in the persistent store manual, namely that the patterns of which objects are to be stored in PS, must be defined in the LIB slot of betaenv. You should therefore restructure along the following line: File cal.bet: --- LIB: attributes --- Person: (# Bill: @Integer; Name: ^Text; No: @Integer; #); Calender: arraycontainer (# element:: Person; CapacityInitial:: (# do 12->value; INNER #) #); And then INCLUDE this file in your progran below (naturally remove the corresponding declarations :-), then everything should go fine. Regards, Jørgen Lindskov Knudsen Bo Normann wrote in message <36B1F583.10425635@stofanet.dk>... >Hello, > >I want to save the following stucture : > > Cal: ^Calender; > exist: @boolean; > PSname : ^text; > Person: (# Bill: @Integer; Name: ^Text; No: @Integer; #); > Calender: arraycontainer > (# > element:: Person; > CapacityInitial:: (# do 12->value; INNER #) > #); > >in a persistent store, and I've done it like this > > &Calender[]->Cal[]; > Cal.init; > Cal.CapacityInitial; > 'Hej' -> psName[]; > true -> exists; > open: > psName[] -> PS.openWrite > (# notFound::< > (# do psName[] -> PS.create; false -> exists; leave open #) > > #); > (if not exists then > 'created' -> putLine; > (Cal[],'Roomlist') -> PS.put; > else > 'opened' -> putLine; > ('Roomlist', Cal##) -> PS.get -> Cal[]; > if); > PS.close; 'closed' -> putLine; > >But when it is about to be created the following error occurs : > >Component instance of PROGRAM - encountered > >ObjectSerializer: Components not handled. > >Now I know that components can´t be stored persistent but I've made >something similar last time I used BETA, and it worked then and I don't >see that I've declared any components ! > >If you know, then please write > >Kind regards >Bo >