Re: [BLACKBOX] ARRAY as CONSTANT

From: [at]} <Gérard>
Date: Mon, 11 Feb 2008 23:07:20 +0100

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

Oleg N. Cher a écrit :
> Chris, may be is there method to open array from resource,
> that linked to executable?
>
I'd found a trick when I was writing Babel. I had to initialise a rather
big integer array (5459 elements) at load time and I did not want to use
an auxiliary file. I wrote a tool that could translate my array into a
list of instructions: a[0]:=n0; a[1]:=n1; etc... where n0, n1, ... were
the elements of my array. Then I wrote a module, BabelInit0, that
included these instructions, and filled the integer array, which was a
public variable in another module, BabelInit. So the process was the
following one:

    - BabelInit calls BabelInit0 through the Dialog.Call procedure;
    - BabelInit0 fills the exported integer array BabelInit.a;
    - BabelInit unloads BabelInit0 through the Kernel module, so that
there is no more duplicated loaded data.

The tool that writes the a[i]s is contained in the BabelBinText.BinInt
procedure.

Cheers.

Gérard


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1462214871_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBPbGVnIE4uIENoZXIgYSBcJ2U5
Y3JpdCA6XHBhcg0KPiBDaHJpcywgbWF5IGJlIGlzIHRoZXJlIG1ldGhvZCB0byBvcGV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hYmVsSW5pdCB1bmxvYWRzIEJhYmVs
SW5pdDAgdGhyb3VnaCB0aGUgS2VybmVsIG1vZHVsZSwgc28gdGhhdCBccGFyDQp0aGVyZSBpcyBu
byBtb3JlIGR1cGxpY2F0ZWQgbG9hZGVkIGRhdGEuXHBhcg0KXHBhcg0KVGhlIHRvb2wgdGhhdCB3
cml0ZXMgdGhlIGFbaV1zIGlzIGNvbnRhaW5lZCBpbiB0aGUgQmFiZWxCaW5UZXh0LkJpbkludCBc
cGFyDQpwcm9jZWR1cmUuXHBhcg0KXHBhcg0KQ2hlZXJzLlxwYXINClxwYXINCkdcJ2U5cmFyZFxw
YXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ug
d2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9
fQBZAAAA
----boundary-LibPST-iamunique-1462214871_-_---
Received on Mon Feb 11 2008 - 23:07:20 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:04 UTC