multi-column comboboxes -> HISE crashes constantly
-
-
@Oli-Ullmann look at what you are getting back in the array sampleMaps after you've done the substitution, you are actually probably better off doing
if(map.indexOf("Bass_") == 0)
rather than
if(map.contains("Bass_"))
to make sure you are replacing one only occurrence
Dave's approach is even better...
-
@Lindon Thank you!
-
@Oli-Ullmann this is interesting:
const var sampleMaps = ["Bass_ONE","Bass_Two","Bass_three"]; const cmbSamples = Content.getAllComponents("ComboBox"); for (map in sampleMaps) { reg firstSegment = map.substring(0, map.indexOf("_") + 1); reg secondSegment = map.substring(map.indexOf("_") + 1, map.length); Console.print(firstSegment.indexOf("_")); firstSegment.replace("_", "::"); Console.print(firstSegment); Console.print(secondSegment); }
replace isnt working....for me at least..
-
@Lindon Ok here you go.. the best of Dave and me ...
const var sampleMaps = ["Bass_ONE","Bass_Two","Bass_three","Gtr_One"]; const cmbSamples = Content.getAllComponents("ComboBox"); for (map in sampleMaps) { reg firstSegment = map.substring(0, map.indexOf("_") + 1); reg secondSegment = map.substring(map.indexOf("_") + 1, map.length); firstSegment = firstSegment.replace("_", "::"); map = firstSegment + secondSegment; } Console.print(trace(sampleMaps)); populateComboBoxes(); inline function populateComboBoxes() { for(c in cmbSamples) { c.set("items", sampleMaps.join("\n")); } }
-
@Lindon Thank you very much! I'll try that out right away! :-)
-
@Lindon Wrap it in a function to avoid wasting reg variables.
-
@d-healey yes yes ....I know...Im lazy.
-
@Lindon so here is it all wrapped in one function call
const var sampleMaps = ["Bass_ONE","Bass_Two","Bass_three","Gtr_One"]; const cmbSamples = Content.getAllComponents("ComboBox"); populateComboBoxes(); inline function populateComboBoxes() { for (map in sampleMaps) { local firstSegment = map.substring(0, map.indexOf("_") + 1); local secondSegment = map.substring(map.indexOf("_") + 1, map.length); firstSegment = firstSegment.replace("_", "::"); map = firstSegment + secondSegment; } for(c in cmbSamples) { c.set("items", sampleMaps.join("\n")); } }
-