Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!ames!haven!udel!rochester!rit!ultb!rxg3321 From: rxg3321@ultb.isc.rit.edu (R.X. Getter) Newsgroups: comp.lang.modula2 Subject: Re: Clever way to deal with this? Message-ID: <2197@ultb.isc.rit.edu> Date: 13 Feb 90 18:07:45 GMT References: <90043.054652MARK@UCF1VM.BITNET> Reply-To: rxg3321@ultb.isc.rit.edu (R.X. Getter ) Organization: Information Systems and Computing @ RIT, Rochester, New York Lines: 29 In article <90043.054652MARK@UCF1VM.BITNET> Modula2 List writes: >Anyone know of a clever way to express this in Modula-2? > >I have a data structure consisting of a cardinal value followed by a >variable number of characters. The cardinal indicates how many characters >follow. you need a linked list of characters to handle this. TYPE string = RECORD numChars : CARDINAL; text : POINTER TO Node; END; Node = RECORD char : CHAR; next : POINTER TO Node; END; you will also need a bunch of utility procedures for manipulating this. also, the cardinal value isn't really needed unless you're using it as a reference. What are you doing? the only things I have ever seen which use a structure like this are basic interpreters. that's how they do strings. no sig yet, Robert Getter