Line 111 Indent Error


#1

I’m trying to revise old code I wrote a while ago. I think I should mention I sent it over a server dropbox, and also a zipped email because I didn’t have my usb.

Up to the first choice, I get an *Invalid indent error for line 111, expected # was goto. There is nothing on 111, it’s space to organize the code. There aren’t even spacebars in it.

I deleted the section of code and replaced it, but the error persists. I cannot see what is wrong that blocks the first choice. In fact, the error is said to be located far from the first choice; over a couple of them actually.

 #$18
  *goto 1

(here is line 111)
`
`
`
`
*label 4
knfefefe
*finish

#2

Is that “goto 1” indented in the code for the choice? Like:

#$18
  *goto 1

I get errors like that when I forget to indent. Sometimes the line numbers are a bit wonky, but I haven’t yet figured out why.


#3

You need to cut and paste the code in preformatted text so that the indentations show up correctly, as @Elfmonkey did. That’ll make it easier to see what the problem is. It sounds like you forgot to include an #option after a choice, and instead put a *goto at that level of indentation. The error message about line 111 is simply where that flaw manifests; it’s not where the mistake is made in the first place. (Like realizing at the movie theater that you left your tickets at home - you made the mistake at home, not at the theater, even though it’s at the theater that you realized it.)


#5
*choice

 #$10
  *goto 1

 #$27
  `
  *goto 4

 #$18
  *goto 1

(line 111)

*label 4
knfefefe
*finish

Completely remade piece of code. Still doesn’t work though.


#6

This could be the forum re-formatting text (I’ve had that happen trying to copy-paste properly spaced text.) However, if that is how it’s spaced, try using at least two spaces for any given indent.

What’s up with ’ after #27? Is that the Choicescript equivalent of a blank line? I don’t use those in my code and only use a double carriage return (like between #$10 and #$27) if I actually want to put a paragraph break in some text… this may be why I can’t see any other errors.


#7

I see that when I make a * or #, I’d only need to set the executing code after 1 indent, or more specifically a space. I don’t use [tab], I use [Space].

Anyway, the ` is to help indicate both when coding and personally testing the program that the choice is the correct solution. It is only reading text resulting from the choice.

I believe the shown code is correctly formatted.


#8

I feel like I’d have to manually recreate the code.

I’ve run into invisible extra [Enter] characters before * that I delete, but visually unchanging the code.

Also, I’ve reduced the startup up to the first choice, but the error comes back, manifesting at a line far beyond the expanse of the text document.

I have more work to do.


#9

That could also be - did you write this in a text-only program, or a word processing program? I got all kinds of weird errors when I tried to paste code from MS-Word and then find-and-replace the broken symbols; it worked all right when I deleted and put back in all of the carriage returns, but whenever I missed one my code invisibly broke again.


#10

I usually first write in MSW, but this was created in Notepad.

There’s this weird thing where I seem to find invisible carriage returns, like there are two on the same line. I think they could cause problems in the code.