Path: news.cs.au.dk!not-for-mail From: "Kasper Østerbye" Newsgroups: comp.lang.beta Subject: Re: Cannot copy NONE? Date: Wed, 17 Nov 1999 12:34:58 +0100 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 61 Message-ID: <80u3t2$8m7av$1@xinwen.cs.au.dk> References: <19991111233439.401.qmail@noatun.mjolner.dk> NNTP-Posting-Host: xmas.cs.au.dk X-Trace: xinwen.cs.au.dk 942838498 9117023 255.255.255.255 (17 Nov 1999 11:34:58 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 17 Nov 1999 11:34:58 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: news.cs.au.dk comp.lang.beta:12165 This is not a Beta specific problem, but common to all languages where a reference can become none. The best I can come up with, is to write t[] -> copy -> u[] instead of t.copy -> u[] the copy pattern can then look like copy:(# original, copy : ^ Text enter original[] do (if original[] = none then none -> copy[] else "make copy of original" -> copy[] if) exit copy[] #) -- Kasper [tricos.com] Sascha Kimmel wrote in message news:19991111233439.401.qmail@noatun.mjolner.dk... > Hi! > > I found something quite interesting which does not help to generate > compact code - instead it becomes a bit complicated: > > t,u:^text; > do > none->t[]; > t.copy->u[]; > > *** THIS GIVES A "REFERENCE *** > *** IS NONE" RUNTIME ERROR !! *** > > Well, normally one would not set a text reference to none, but if I read > some data into an array (^text) and just want to copy the values (not > the references!) of the corresponding variables into the array (or to > any other text reference), it is not possible to do this with small code > if it's possible that there are NONEs in there. > > So do I really need to use > > (if (t[]<>none) > then > t.copy->u[]; > else > none->u[]; > if); > > instead of a small t.copy->u[] ? > > Any help is appreciated! > > Regards, > Sascha Kimmel > > >