Sign In

Idk some kinda ENDIF syntax error problem

#1✎ 153ChaseCZIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesZelda Is Awesome!I love The Legend Of Zelda!Express YourselfYo
I haven't opened smilebasic in a long time and i got a problem.
Here on this pic whenever i run the code it just gives me a syntax error on line 110, if i change it to just END, it gives me a syntax error on line 118 and if do the same on the line 118 then it gives me a WEND without WHILE error even though both are there... Idk i didn't do anything in smilebasic for a long time and i feel like i forgot a lot of things
Posted 3 months ago

#2✎ 174NathanielAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsScholarReceived for knowing a great deal about programming topicsAchievementsFinal(?) Contest WinnerI won the (possibly) final SmileBASIC Source Contest! October 2018Programming ContestIf you start a FOR loop inside an IF statement, you must end it with NEXT before it reaches ENDIF.
I think you're also missing an ENDIF near WAIT 1.
Posted 3 months ago

#3✎ 153ChaseCZIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesZelda Is Awesome!I love The Legend Of Zelda!Express Yourself

If you start a FOR loop inside an IF statement, you must end it with NEXT before it reaches ENDIF.
I think you're also missing an ENDIF near WAIT 1.

Oh yeah so i must put the NEXT which is at the bottom above ENDIF and yeah idk for sure but i think there already is ENDIF below WAIT 1
Posted 3 months ago
Edited 3 months ago
by ChaseCZ

#4✎ 453kenchicFirst YearMy account is over 1 year oldWebsiteBeginner ProgrammerI'm just starting out! I'm still trying to grasp the basics.Programming Strengthosu! Is Awesome!I love osu!Express YourselfKeywords that start and end must not intersect, but only enclose code.
Tabbing in when you go into one of these 'blocks' simplifies knowing whether or not you've already given the ending keyword.
example:
WHILE 1
IF what THEN
FOR I=0 TO yeet
?"your mom",I
NEXT
ENDIF
WEND
Posted 2 months ago