Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!sys.uea!cmp8118 From: cmp8118@sys.uea.ac.uk (D.S. Cartwright) Newsgroups: comp.lang.modula2 Subject: Re: Clever way to deal with this? Message-ID: <1294@sys.uea.ac.uk> Date: 13 Feb 90 13:02:06 GMT References: <90043.054652MARK@UCF1VM.BITNET> Organization: UEA, Norwich, UK Lines: 23 MARK@UCF1VM.BITNET (Mark Woodruff) 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. Well, how about some sort of RECORD structure thus : TYPE VarString : POINTER TO CHAR ; DataStructure : RECORD NoOfChars : CARDINAL ; Chars : VarString ; END (* RECORD *) ; You could then knock up some little routine to handle the creation and general all-round handling of the linked list of characters without too much hassle, and all should [!!!! }:^)] be hunky-dory. Dave C, SYS II, UEA, Norwich.