Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: LDStudios on January 14, 2014, 06:21:23 am

Title: strings..
Post by: LDStudios on January 14, 2014, 06:21:23 am
Does anyone know why commands like \n (new line) and \b (backspace) work fine for me in student software, but on calc, they just display a rectangle
Title: Re: strings..
Post by: Adriweb on January 14, 2014, 11:21:45 am
Yep, it's a known issue - don't rely on them.
Instead, split the string yourself (at each \n) and store the parts in a table which you'll iterate through and call drawString on each parts.

example :
Code: [Select]
local myTable = myString:split("\n")
    for i, str in ipairs(myTable ) do
        gc:drawString(str, 5, 5 + i * 10, "top")
    end