🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #20741

Re: HyperCard arrays

#20741
From: Chuq Von Rospach
Date: Mon, 26 Oct 1987 00:13
21 lines
1418 bytes
>HyperTalk doesn't directly support arrays.  Is there some way to get the
>same effect (by using variables names like VName & k, where k contains
>a number that changes?)?  Has anyone come across this yet and found a
>good solution?

If each array entry can be stored as a word, it's pretty simple. Define a
field, VName, and store things as words in the field. VName[k] then
becomes "word k of field Vname". To store, you "put foo into word k of field
Vname" and to read you "put word k of field Vname into foo"

By using "before" and "after" you could even create a sorted array without
having to do any physical rearrangment. 

If the values don't fit well into words, you could do the same (with some
slightly greater complexity) using fields or lines in a single field as
well.

chuq

Chuq Von Rospach					chuq@sun.COM
Editor, OtherRealms					Delphi: CHUQ
Technical Details
Message-ID: <31915@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!plaid!chuq
References: <173@stech.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!plaid!chuq
From: chuq%plaid@Sun.COM (Chuq Von Rospach)
Newsgroups: comp.sys.mac
Subject: Re: HyperCard arrays
Message-ID: <31915@sun.uucp>
Date: Sun, 25-Oct-87 19:13:23 EST
Article-I.D.: sun.31915
Posted: Sun Oct 25 19:13:23 1987
Date-Received: Tue, 27-Oct-87 05:50:41 EST
References: <173@stech.UUCP>
Sender: news@sun.uucp
Reply-To: chuq@sun.UUCP (Chuq Von Rospach)
Organization: Fictional Reality, uLtd
Lines: 21