Announcement

Collapse
No announcement yet.

How to update an array of strings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to update an array of strings

    Hi everyone,

    I would like to save file names into an array of strings.

    My code doesn't update FileName[0].

    Here is my code :
    Code:
    var FileName[4] := ["File1.txt","File2.txt","File3.txt","File4.txt"];
    
    to(FileName[0]); print("OtherNam.txt");
    
    str_Printf(&FileName[0],"\nNew name: %s\n");                   // the result is "File1.txt" instead of "OtherNam.txt"
    In my final code, the "OtherNam.txt" won't be a constant, but an input string change by a keyboard using Magickeyboard.

    regards.
    Sylvain

  • #2
    Hi,

    Good day.
    You can try,

    Code:
     FileName[0] := "OtherName.txt";
    I hope this helps.

    Best Regards,
    Ferdinand

    Comment


    • SylvainLAURENT
      SylvainLAURENT commented
      Editing a comment
      Hi,

      I've made an array of array of strings and that's work fine.

      Initially, it's a little bit difficult to understand how to convert : string to array to char to int to float to ....

      There are lot of functions to do that.

      When we are used to C or Python languages ....

      But it's a nice tool, and thanks for your support

      Regards.
Working...
X