# Syntax Error in Sublime KSP



## Mysticalsuffix (Feb 24, 2022)

It doesn't like line 169 and I cannot figure out why. All help is appreciated.

Thanks!


----------



## d.healey (Feb 24, 2022)

You have a mismatch in the amount of ifs, elses, and end ifs.


----------



## ScoringFilm (Feb 24, 2022)

This line has been repeated:


----------



## Mysticalsuffix (Feb 25, 2022)

d.healey said:


> You have a mismatch in the amount of ifs, elses, and end ifs.


Thanks so much! BTW is this THE D. Healey from Xtant Kontakt KSP Learning projects? If so, I wanted you to know you are held as greater than rock star status in my house. I really appreciate the videos and all the help. YOU ROCK!!!


----------



## Mysticalsuffix (Feb 25, 2022)

Please go easy on me as I would like to emphasize my Newb status. It seems Sublime wants me to put "end on" on line 159, but I don't understand why. It seems like all the if statements are aligned unless I'm mistaken.


----------



## Mysticalsuffix (Feb 25, 2022)

ScoringFilm said:


> This line has been repeated:


Thank you so much!


----------



## Duncan Krummel (Feb 25, 2022)

Mysticalsuffix said:


> Please go easy on me as I would like to emphasize my Newb status. It seems Sublime wants me to put "end on" on line 159, but I don't understand why. It seems like all the if statements are aligned unless I'm mistaken.


Looks as though your End If in 168 is closing the If in 166, and not the If in 145. So, and others may correct me if wrong, it seems to me as though you’re missing an End If for line 145.


----------



## d.healey (Feb 25, 2022)




----------



## EvilDragon (Feb 25, 2022)

You can also always just do Ctrl+A to select all, then Ctrl+Shift+L to reindent the whole code. It should be fairly easy to see then if indentation got messed up somewhere.


----------



## Mysticalsuffix (Feb 28, 2022)

d.healey said:


>


I indented to the color codes the best way I thought you meant, but I'm still getting a syntax error and I'm just stumped. Thanks again for all your help.


----------



## Mysticalsuffix (Feb 28, 2022)

EvilDragon said:


> You can also always just do Ctrl+A to select all, then Ctrl+Shift+L to reindent the whole code. It should be fairly easy to see then if indentation got messed up somewhere.


I learned something new. Thanks for the update in Sublime btw.


----------



## d.healey (Feb 28, 2022)

Mysticalsuffix said:


> I indented to the color codes the best way I thought you meant, but I'm still getting a syntax error and I'm just stumped. Thanks again for all your help.


What's that else doing on line 166?


----------



## EvilDragon (Feb 28, 2022)

Yeah that one is superfluous.

You should also dedent the if/end if surrounding your roundrobin() function inlining there.


----------



## Mysticalsuffix (Feb 28, 2022)

d.healey said:


> What's that else doing on line 166?


It was originally an "else if" statement. I tried moving the "if" down to see if that may have been an issue. It turned out to not be an issue and I moved the "if" back to the same line as the "else." The indentation marks you gave as well as the "else if" statement change corrected all the errors. Thanks again so much for your help. I really appreciate it.


----------



## Mysticalsuffix (Feb 28, 2022)

EvilDragon said:


> Yeah that one is superfluous.
> 
> You should also dedent the if/end if surrounding your roundrobin() function inlining there


It worked. Thanks for your patience and all your help!


----------

