Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indenting confused by single line multi statement if statment #73

Open
sjbrower opened this issue Jul 14, 2023 · 1 comment
Open

Indenting confused by single line multi statement if statment #73

sjbrower opened this issue Jul 14, 2023 · 1 comment

Comments

@sjbrower
Copy link

A single line but multi statement if confuses it unless the statement ends with a ':'

if X = 1: Y = 2: Z = 3: end if

will lose indenting on it and subsequent lines, but

if X = 1: Y = 2: Z = 3: end if:

works fine (notice the trailing colon).

@TwitchBronBron
Copy link
Member

Here is another example:

function FormatTime(Seconds)
    Result = ""
if (Seconds > 86400): Result += (Seconds \ 86400).ToStr() + "d ": Seconds = Seconds mod 86400: end if
Result += (Seconds \ 3600).ToStr() + "h ": Seconds = Seconds mod 3600
Result += (Seconds \ 60).ToStr() + "m ": Seconds = Seconds mod 60
Result += (Seconds).ToStr() + "s "
return Result
end function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants