🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4938

Re: Clever way to deal with this?

#4938
From: D.S. Cartwright
Date: Tue, 13 Feb 1990 13:02
23 lines
1079 bytes
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.
Technical Details
Message-ID: <1294@sys.uea.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!sys.uea!cmp8118
References: <90043.054652MARK@UCF1VM.BITNET>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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