(unknown charset) Re: [BLACKBOX] ARRAY as CONSTANT

From: (unknown charset) [at]} <Josef>
Date: Tue, 12 Feb 2008 09:22:05 +0100

----boundary-LibPST-iamunique-788903025_-_-
Content-type: text/plain

I guess Wirth would have introduced a little auxiliary procedure that does the initialization
based on a fixed number of parameters, let's say 10.

PROCEDURE InitArray10(startIndex, x0, x1, x2...x9: INTEGER);...

The code to fill the array is than much shorter (both in the source code and in the binary code)
than individual assignments.
If the array is large make sure to init it in the module body, ie only once.

Don't even think about abusing code procedures for that purpose.

- JT



----- Original Message -----
From: "Oleg N. Cher" <allot{([at]})nowhere.xy
To: <BLACKBOX{([at]})nowhere.xy
Sent: Monday, February 11, 2008 9:57 AM
Subject: [BLACKBOX] ARRAY as CONSTANT


> Dear Marc Frei
> & Oberon microsystems crew,
>
> well, BlackBox is useful. But now I have a problem
> with using big initialized arrays.
>
> As you know, we can write in Delphi :
>
> CONST
> a: ARRAY [0..4] OF INTEGER = (1, 2, 3, 4, 5);
>
> And we have a constantly array, initialized in compile-time.
>
> In standard Oberon-2 it is not so good. But we can write:
>
> PROCEDURE -Resource;
> 000H,000H,001H,...;
>
> ...
>
> The array accessible with :
>
> SYSTEM.GET(SYSTEM.ADR(Resource) + index, x)
>
> Not very nice method, isn't it?
> Eh...
>
> I write in BlackBox :
>
> PROCEDURE [code] Resource
> 000H,000H,001H,...;
>
> And MAXIMAL possible size of this procedure is 254 bytes :-(
> If it is greater than 254, here is compiler error :
>
> more actual than formal parameters
>
> With this experiments, I understand, that Oberon-2 and
> BlackBox can not works with big arrays, initialized in
> compile-time. And it's strange.
> Of course, I can initial array in run-time, but it is
> a very big manual work and inefficient large module code.
>

> Please, help me,
> must be a better method.
>
> Thanks for all.
>
>
> Oleg N. Cher,
> Colossoft Research.
> allot{([at]})nowhere.xy
> 2008-02-11
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-788903025_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTFcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEkgZ3Vlc3MgV2lydGggd291bGQgaGF2ZSBpbnRy
b2R1Y2VkIGEgbGl0dGxlIGF1eGlsaWFyeSBwcm9jZWR1cmUgdGhhdCBkb2VzIHRoZSBpbml0aWFs
aXphdGlvblxwYXINCmJhc2VkIG9uIGEgZml4ZWQgbnVtYmVyIG9mIHBhcmFtZXRlcnMsIGxldCdz
IHNheSAxMC5ccGFyDQpccGFyDQpQUk9DRURVUkUgSW5pdEFycmF5MTAoc3RhcnRJbmRleCwgeDAs
IHgxLCB4Mi4uLng5OiBJTlRFR0VSKTsuLi5ccGFyDQpccGFyDQpUaGUgY29kZSB0byBmaWxsIHRo
ZSBhcnJheSBpcyB0aGFuIG11Y2ggc2hvcnRlciAoYm90aCBpbiB0aGUgc291cmNlIGNvZGUgYW5k
IGluIHRoZSBiaW5hcnkgY29kZSlccGFyDQp0aGFuIGluZGl2aWR1YWwgYXNzaWdubWVudHMuIFxw
YXINCklmIHRoZSBhcnJheSBpcyBsYXJnZSBtYWtlIHN1cmUgdG8gaW5pdCBpdCBpbiB0aGUgbW9k
dWxlIGJvZHksIGllIG9ubHkgb25jZS5ccGFyDQpccG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