Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!acorn!osmith From: osmith@acorn.co.uk (Owen Smith) Newsgroups: comp.sys.acorn Subject: Re: More about BASIC vs. Pascal vs. C (the flame war continues !) Message-ID: <5256@acorn.co.uk> Date: 19 Feb 91 17:47:46 GMT References: <1991Feb15.131220.7801@vax1.tcd.ie> Sender: osmith@acorn.co.uk Distribution: comp Organization: Acorn Computers Ltd, Cambridge, England Lines: 19 In article <1991Feb15.131220.7801@vax1.tcd.ie> hughesmp@vax1.tcd.ie writes: >Just out of interest, is there an equivalent of the BASIC 'DATA', 'READ', >and 'RESTORE' constructs in C, PASCAL, or MODULA2? You don't do it in the same way. In C, you would use static initialised structures (ie. a structure which already has data values put into it at compile time). This is much more efficient to access than DATA statements (a single LDR instruction for an integer value) and all the values can be randomly accessed at any time whereas READ is inherently sequential in nature. You can also over-write the initial values at runtime without any difficulty. Owen. (PS. Please can people stop cross-posting lots of stuff to eunet.micro.acorn) The views expressed are my own and are not necessarily those of Acorn.