choose 4

constant string
Author: Johannes Taelman
License: BSD
Github: rbrt/string/choose 4.axo

Inlets

int32.positive sel

Outlets

charptr32 string

Attributes

spinner maxLength

table str0

table str1

table str2

table str3

Declaration
char c0[attr_maxLength];
char c1[attr_maxLength];
char c2[attr_maxLength];
char c3[attr_maxLength];
Init
strcpy(&c0[0], "attr_str0");
strcpy(&c1[0], "attr_str1");
strcpy(&c2[0], "attr_str2");
strcpy(&c3[0], "attr_str3");
Control Rate
switch (inlet_sel & 3) {
case 0:
default:
  outlet_out = (char *)c0;
  break;
case 1:
  outlet_out = (char *)c1;
  break;
case 2:
  outlet_out = (char *)c2;
  break;
case 3:
  outlet_out = (char *)c3;
  break;
}

Privacy

© 2024 Zrna Research