[SOLVED] Writing the text to file that includes a 'tab' key

Discussion in 'Programming' started by Jus, Sep 28, 2016.

  1. Jus

    Jus Member

    Joined:
    Aug 31, 2016
    Posts:
    28
    Hi all,

    I have seemingly a simple question but I searched around and couldn't find the answer. I'm trying to write text to text files and I want to include a "tab" to separate the text. If it was in c++ it'd be like:

    string = "HP\tSP\tAttack\tdefense";

    then write the string to file.

    How do I do it in GM? I know there are keyboard constants for all keyboard keys, like vk_tab for tab, but how do I use it in my case? Thanks in advance.
     
  2. Catan

    Catan Member

    Joined:
    Jun 20, 2016
    Posts:
    484
    You could try something like string = "HP"+chr(9)+"SP"+chr(9)+"Attack"+chr(9)+"defense";
     
    ParodyKnaveBob likes this.
  3. Jus

    Jus Member

    Joined:
    Aug 31, 2016
    Posts:
    28
    Thanks! Works like a charm!
     
    ParodyKnaveBob likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice