Tried to use \t to make a tab in a text line and my header gradient like 6 lines down broke

yeah.  exactly my title.  I have a text field and since I’m using \n for new lines, I tried to use \t to add in a tab to the text.  I hit save, it tried to run, and I got an error for line 62.  The problem is, line 62 deals with a header box I have.  The error is "unexpected symbol near ‘=’ ".  I didn’t touch this line.

I’ve tried checking the console- no more information than the pop-up in the simulator.  The rest of the error is essentially just “there’s an error from main.lua line 25,” but line 25 is just a composer line that sends the app to the reflIndex.lua file I’m working on where the error is on line 62 as mentioned above.

I’m Attaching the reflIndex.lua file alone currently if someone wouldn’t mind checking it out.  I know it’s messy but I’m currently learning and building this at the same time and I try to clean up what I KNOW for a fact I don’t need (even as a reference) as I go.  If the full source is needed, please comment and I’ll upload everything to my G Drive and share from there.

-Thanks

Found the broken part and I’m posting this as an example of the differences between humans and computers.

If you look at the programming, I’m got text1 waiting to have something added to the end of it (appended).  Every line below it until “HeaderGradient1” (HG1)is commented out, meaning the compiler just ignores it.  Now we as humans know what’s going on, but what the computer sees is that I’m trying to add whatever is in HG1 to “text1”, and when I start defining HG1, the compiler goes “hey,hey,hey!  that’s not how this syntax works.  what’re you trying to do?”  If I had used == instead of =, it might not have thrown an error for the same reason, but it would break my HG1 object instead and guarantee an error there.

-- Asphalt text1.text = text1.text ..        --local function textmove() --end     --text:addEventListener("onScreen", textMove)   -- Header HeaderGradient1 =  { type = "gradient", color1 = {.18,.18,.18}, color2 = {.4,.4,.4}, direction = "down", }

It’s not the = or == that is causing your problem, they are 2 distinctly different operators.

= means you are telling the code that the object on the left is equal to the object on the right.

== means you are asking whether or not the object on the left is equal to the object on the right.

You’re issue is this:

text1.text = text1.text ..

There is no need to set up your text object to “wait”  until you have something to append to it. Just append the object at the point where you actually have some text to append to it.

As soon as you do this 

..

Lua expects the very next thing written to be a string (or something that it can turn into a string such as a number). If you don’t know what you need to append to it yet, then just don’t write this:

text1.text = text1.text ..

or at the very least just append an empty string:

text1.text = text1.text .. ""

As you say, this is the difference between humans and computers. In it’s defence, the computer can do nothing but follow logic and it’s logical to not leave a text object “open” to be appended at a later date. What if it never gets appended? Then you would have wasted memory that was allocated to hold a string at a later date.

Yeah, I found that.  It’s not that I have the code “waiting” for something to append- I’m creating a dictionary of sorts and forgot to add the text to that line or at least add “” to finish out the statement.  I wrote everything out to explain for anyone having similar issues why exactly the error was occurring where it was and not on the line that was actually broken.  You can’t just follow human logic when dealing with issues- you have to use computer logic.  (Using breaks and such would be key to finding an issue like this if it was a much more complex situation.  As it is, mine is quite similar to a webpage, just with a diff language.)

Found the broken part and I’m posting this as an example of the differences between humans and computers.

If you look at the programming, I’m got text1 waiting to have something added to the end of it (appended).  Every line below it until “HeaderGradient1” (HG1)is commented out, meaning the compiler just ignores it.  Now we as humans know what’s going on, but what the computer sees is that I’m trying to add whatever is in HG1 to “text1”, and when I start defining HG1, the compiler goes “hey,hey,hey!  that’s not how this syntax works.  what’re you trying to do?”  If I had used == instead of =, it might not have thrown an error for the same reason, but it would break my HG1 object instead and guarantee an error there.

-- Asphalt text1.text = text1.text ..        --local function textmove() --end     --text:addEventListener("onScreen", textMove)   -- Header HeaderGradient1 =  { type = "gradient", color1 = {.18,.18,.18}, color2 = {.4,.4,.4}, direction = "down", }

It’s not the = or == that is causing your problem, they are 2 distinctly different operators.

= means you are telling the code that the object on the left is equal to the object on the right.

== means you are asking whether or not the object on the left is equal to the object on the right.

You’re issue is this:

text1.text = text1.text ..

There is no need to set up your text object to “wait”  until you have something to append to it. Just append the object at the point where you actually have some text to append to it.

As soon as you do this 

..

Lua expects the very next thing written to be a string (or something that it can turn into a string such as a number). If you don’t know what you need to append to it yet, then just don’t write this:

text1.text = text1.text ..

or at the very least just append an empty string:

text1.text = text1.text .. ""

As you say, this is the difference between humans and computers. In it’s defence, the computer can do nothing but follow logic and it’s logical to not leave a text object “open” to be appended at a later date. What if it never gets appended? Then you would have wasted memory that was allocated to hold a string at a later date.

Yeah, I found that.  It’s not that I have the code “waiting” for something to append- I’m creating a dictionary of sorts and forgot to add the text to that line or at least add “” to finish out the statement.  I wrote everything out to explain for anyone having similar issues why exactly the error was occurring where it was and not on the line that was actually broken.  You can’t just follow human logic when dealing with issues- you have to use computer logic.  (Using breaks and such would be key to finding an issue like this if it was a much more complex situation.  As it is, mine is quite similar to a webpage, just with a diff language.)