Saving Numbers & Strings into a single file

Discussion in 'KONTAKT: Sampling, Programming & Scripting' started by dfhagai, Jun 12, 2019 at 4:52 AM.

  1. dfhagai

    dfhagai HD

    612
    102
    Aug 24, 2009
    Israel
    Hi,

    I'm working on a multi-script and I'm trying to figure out how to save different script variables (numbers) and strings (text) into a single NKA file.

    I don't want the user to save two external NKA's (one for variables and one for strings)...

    Is this at all possible?

    Thanks!!!
    HD
     
  2. P.N.

    P.N. Active Member

    479
    172
    Aug 14, 2015
    You can't mix strings, integers or real numbers in the same array...
    Integers and real numbers you mght get way with conversions and use a single array (either with integers or real numbers), depending on your goals, but strings are another matter.
     
  3. OP
    OP
    dfhagai

    dfhagai HD

    612
    102
    Aug 24, 2009
    Israel
    So, any workaround for saving an external preset that involves both?
     
  4. P.N.

    P.N. Active Member

    479
    172
    Aug 14, 2015
    Well, if you only needed to save a string variable, you could save_array_str() and use the string as the name of your integer array.
    After, you may use a file selector to browse the integers arrays that were saved with the string name... but... i don't know if this helps your specific scenario.
     
  5. Lindon

    Lindon VST/AU Developer

    757
    264
    Jul 27, 2010
    Republic of Yorkshire
    The way we used to do this was with number substitution. Strings(each character) represented as numbers 0 to 26 and remapped using a string array containing the alphabet.

    We actually used more than 26 slots so we could have spaces , hyphens etc.
     
    P.N. likes this.
  6. P.N.

    P.N. Active Member

    479
    172
    Aug 14, 2015
    Can't do anything for text_edits, but it might be useful to the OP. :)
     

Share This Page