Using unicode?

  1. 3 months ago

    It looks like unicode characters cannot be used in code-editor, for instance this code does not work:

    View1.difficulty = "★".repeat(5)

    Do you plan to allow unicode characters in code?

    Instead of the 'X' in below code, one then could use a unicode symbol, like a star, etc:

    // retrieve difficulty level from database
    var n = rs.difficulty;
    
    // show symbol n times
    View1.difficulty = "X".repeat(n)
  2. marco

    Jun 11 Administrator User since 2016

    Hello @oliver@osswald.com, unicode is fully supported and I just tried to modify the LetsCookNav example and everything worked as expected.

    In InfoView CustomView I deleted the difficulty and _difficulty properties (delete also the exposed difficulty property). Then create a new label (or duplicate and existing label) and then expose the Label.text property as difficulty.

    In Window2.WillShow modify the difficulty related code to:

    var n = rs.difficulty;
    View1.difficulty = "★".repeat(n);

    Press run and everything will work as expected.

  3. Ah! Yes, now it works also for me.
    Thanks again!

or Sign Up to reply!