gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] programargs


From: Dragiša Durić
Subject: Re: [Gm2] programargs
Date: Sun, 7 Apr 2013 11:16:16 +0200

In other languages there are conventions like that. Mine convention (for my in-house scripting language) is - every array index starts with 1, except for strings where it is 0.

But, in Modula-2 there is no such thing. ARRAYs are subscripted with whatever type is specified. Index type  is in most cases some subrange type, but BOOLEAN and CHAR (being of small cardinality) are often used witout subranging. Data type is whatever you need for your application. First index value is whatever value is minimal/first in given index type.
--
Dragiša Durić


On Apr 7, 2013, at 10:51 AM, Noam Kloos wrote:

Christoph,

I have no answer to your question. Though in the source you posted you declare
str : ARRAY(0..49) OF CHAR

being merely a beginner I did learn number arrays start with 0 and CHAR arrays start with 1

Cheers,
Noam.

_______________________________________________
gm2 mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/gm2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]