© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
44 replies
MaGiiKx

❔ 'if' command not working.

Hi, In my program, it uses user input to execute a command (just a mini IDE) but these commands are executed to draw shapes. I am having a problem if my case: "if" and my case "endif". I have attached an image to this post.
the explanation of the commands :

moveto 200 200 (this sets the location of the coordinates to 200, 200)
var size 10 (this declares a variable called size with the value of 10)
If 10 > 20 (if 10 is greater than 20)
Loop 10 (it will draw the shape 10 times)
Circle size (this will draw circle with the value retrieved from the variable called size)
size size + 10 (each time circle is drawn, it will increase variable size by 10.
End (the loop ends here)
Endif (if statement ends here)

my problem is, 10 is not greater than 20, so nothing below the if command should be executed.

the code is below.

https://hastebin.com/novohajilo.http
Screenshot_20230107_141151.png
Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

If(readresult) not working?
C#CC# / help
2y ago
✅ Running cmd line command via c# not working
C#CC# / help
2y ago
❔ if you use a string command in an if command, can you make it case insensitive
C#CC# / help
3y ago
✅ Command Not Found error
C#CC# / help
17mo ago