🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3375

Re: constant tables?

#3375
From: frank
Date: Fri, 15 Mar 1996 07:44
39 lines
1465 bytes
erico@cnmat.berkeley.edu (Eric Obermuhlner) wrote:
> How do I make constant tables?
> 
> I write code for an embedded system. Lookup tables in ROM are a 
pretty useful thing and I just couldn't find a way to do it.
> 
> Did I miss something?
> 
> Something like
> [BEGIN EXAMPLE]
> VAR
>   myTable : ARRAY [0..9] OF CARDINAL = [0, 6, 2, 5, 1, 3, 4, 9, 
8, 7];
> [END EXAMPLE]

Hmm, havn't been doing much MODULA programming lately, but from 
what I take from the MODULA standard, it would be something like:

MODULE example;
TYPE
  CA = ARRAY [0..9] OF CARDINAL;

CONST
  myTable = CA({0, 6, 2, 5, 1, 3, 4, 9, 8, 7});

...

though I can't garantee that the braces ({}) are correct.

-Robert
-- 
Institut fuer Informatik           tel  +41 (0)61 321 99 67
Universitaet Basel                 fax. +41 (0)61 321 99 15
Robert Frank                                        
Mittlere Strasse 142    rfc822: frank@ifi.unibas.ch (NeXT,MIME mail 
ok)  
CH-4056 Basel       X400: 
S=frank;OU=ifi;O=unibas;P=switch;A=arcom;C=ch
Switzerland  
Technical Details
Message-ID: <1996Mar15.084433.46145@yogi.urz.unibas.ch>
Path: arc1-ca.pugleaf.net!ubaclu.unibas.ch!nntp
References: <erico-1403961506370001@infinitehell.cnmat.berkeley.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ubaclu.unibas.ch!nntp
Newsgroups: comp.lang.modula2
Subject: Re: constant tables?
Message-ID: <1996Mar15.084433.46145@yogi.urz.unibas.ch>
From: frank@ifi.unibas.ch
Date: 15 Mar 96 08:44:33 MET
Reply-To: frank@ifi.unibas.ch
References: <erico-1403961506370001@infinitehell.cnmat.berkeley.edu>
Nntp-Posting-Host: woodstock.ifi.unibas.ch
X-Newsreader: Alexandra.app (Version 0.82)