You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for Compound Conditions In WHILE Loops #396
Alternative syntax (inspired by gta3script syntax):
// single condition
WHILE <COND>
...
END
// compound condition (AND/OR)
WHILE <COND1>
OR <COND2>
OR <COND3>
...
END
// single condition
REPEAT
...
UNTIL <COND>
// compound condition (AND/OR)
REPEAT
...
UNTIL <COND1>
OR <COND2>
OR <COND3>
Can be expanded to IF (note that THEN becomes redundant):
I would just stick to high level constructs. There is already too much alternative ways to do same things in SB.
People are spending time on naming labels and inventing their own command names following opcode number instead writing the script itself.
? Do is probably more fitting natural language, but it is introducing an new keyword?
If there is do I naturally start thinking about do-while-end instead of repeat-until
// compound condition (AND/OR)
WHILE <COND1>
OR <COND2>
OR <COND3>
...
END
Oh ok there is OR as prefix for every condition line.
Does it support mixed logical operations? If not it will be frequently asked question why this does not work.
// compound condition (AND/OR)
WHILE <COND1>
OR <COND2>
OR <COND3>
...
END
Oh ok there is OR as prefix for every condition line. Does it support mixed logical operations? If not it will be frequently asked question why this does not work.
No, it does not support mixed operators. Either all AND, or all OR. That's how it works in original scripts too.
So there is no benefit in that approach.
You are trying to fix one of the anomalies: the conditions in loops are not behaving same way as in if.
Now you inventing ways to make them work differently anyway.
Keep it simple and consistent. Nobody have head to remember all the quirks.
Activity
x87 commentedon May 2, 2026
Alternative syntax (inspired by gta3script syntax):
Can be expanded to IF (note that
THENbecomes redundant):MiranDMC commentedon May 2, 2026
So where conditions ends and body starts? Seems like it makes it only more convoluted instead clearer
x87 commentedon May 2, 2026
if and
foo()
foo()
foo()
then
end
MiranDMC commentedon May 2, 2026
There is no
thenin previous examplex87 commentedon May 2, 2026
AND / OR itself are indicators
MiranDMC commentedon May 2, 2026
IF 24These values are not even an enum.
I would just stick to high level constructs. There is already too much alternative ways to do same things in SB.
People are spending time on naming labels and inventing their own command names following opcode number instead writing the script itself.
MiranDMC commentedon May 2, 2026
Didn't we earlier discussed the
?
Dois probably more fitting natural language, but it is introducing an new keyword?If there is
doI naturally start thinking aboutdo-while-endinstead ofrepeat-untilx87 commentedon May 2, 2026
this syntax was mentioned nowhere in the proposal, read carefully
MiranDMC commentedon May 2, 2026
Oh ok there is
ORas prefix for every condition line.Does it support mixed logical operations? If not it will be frequently asked question why this does not work.
x87 commentedon May 2, 2026
No, it does not support mixed operators. Either all AND, or all OR. That's how it works in original scripts too.
MiranDMC commentedon May 2, 2026
So there is no benefit in that approach.
You are trying to fix one of the anomalies: the conditions in loops are not behaving same way as in
if.Now you inventing ways to make them work differently anyway.
Keep it simple and consistent. Nobody have head to remember all the quirks.
Same with
THENandDOkeywordsx87 commentedon May 2, 2026
Which part of the proposal is inconsistent? While/Repeat/If all use either single condition, or multiple conditions joined with AND or OR.
MiranDMC commentedon May 2, 2026
#396 (comment)
Proposing syntax inspired by gta3script. I would like to see SB inspired one instead...
Take code:
Replace
ifwithwhile, done. No need for overthinking now or later when typing in scripts.x87 commentedon May 2, 2026
But it does not work with REPEAT..UNTIL, that's the issue
MiranDMC commentedon May 2, 2026
repeat-until-endeasy to deduce as no new keywords are introduced or new concept of prefixing each condition expression