Quote:
Originally Posted by fundorin
Could you, please, be so kind an just teach me of how to generate variable names like this "text[1]" and store info in them, like arrays with EEL2?
|
The string slots are accessed just by the numbers that are their addresses. EEL knows them from normal number as they are used as arguments for string functions or by the "#" operator for named strings inhabitating additional slots, or (as a special syntax candy) with the += operator being mapped to strcat(), while the = operator (like any other) simply works on the numbers.
In my OSCII-Bot script I do:
Code:
@init:
l2s = 0; // strings base slot
l22 = 0; // array midi CC messages msg2 base
n = 0;
// Main Fader <-> 0x24
strcpy(n+l2s, "/lr/mix/fader");
l22[n] = 0x24;
n += 1;
// Fader 4 <-> 0x1d
strcpy(n+l2s, "/ch/04/mix/fader");
l22[n] = 0x1d;
n += 1;
// Fader 5 <-> 0x1e
strcpy(n+l2s, "/ch/05/mix/fader");
l22[n] = 0x1e;
n += 1;
// Fader 6 <-> 0x1f
strcpy(n+l2s, "/ch/06/mix/fader");
l22[n] = 0x1f;
n += 1;
...
@timer
!t ? (
t -= 1;
ti ? (
ti -= 1;
l2o[ti] = -1;
oscsend(XR18, ti+l2s);
printf("-> %s\n", ti+l2s);
);
-Michael