✅ CS1001 error

So im working on an assignment and wrote the full code; CS1001 error seems to not want to go away. I looked it up and it seems to miss an identifier. on line three where the error is present i have namespace written; isnt that an identifier?
49 Replies
Kouhai
Kouhai2y ago
If possible, show your code
sunny innit
sunny innitOP2y ago
would a screenshot suffice? or what would you prefer?
Kouhai
Kouhai2y ago
Yeah sure
Denis
Denis2y ago
$code
MODiX
MODiX2y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
sunny innit
sunny innitOP2y ago
BlazeBin - aenkmzogoqag
A tool for sharing your source code with the world!
Denis
Denis2y ago
it was easier to paste the code here :p
sunny innit
sunny innitOP2y ago
Hahaha i can do that too, i just feel like it would be cluttery
Kouhai
Kouhai2y ago
If the code is exactly the same as you've posted, it should compile
sunny innit
sunny innitOP2y ago
i cant run it at all sadly
Denis
Denis2y ago
Do not use any special characters in code
sunny innit
sunny innitOP2y ago
Denis
Denis2y ago
by that I mean the accented O in Ovning
Kouhai
Kouhai2y ago
surprisingly this compiles on my machine Laugh
sunny innit
sunny innitOP2y ago
o_o maybe i should try creating a new project or something?
Kouhai
Kouhai2y ago
But yeah, Denis is probably right
Denis
Denis2y ago
that is a general guideline for programming, and make sure to call your classes, properties, methods etc. in english The error is referring to line 3, which is the namespace
sunny innit
sunny innitOP2y ago
i changed it to "Ovning" and its still not working 😮
Denis
Denis2y ago
Try creating a new project with a better name maybe that helps
Kouhai
Kouhai2y ago
The project name shouldn't show this error
Angius
Angius2y ago
Out of curiosity, try just removing that namespace If that keeps throwing, try using top-level statements If that keeps throwing, ¯\_(ツ)_/¯
sunny innit
sunny innitOP2y ago
Hahaha i created a new project and made the name more arbitrary in english and the error disappeared
Denis
Denis2y ago
😎 case closed
sunny innit
sunny innitOP2y ago
What compiled for you? I cant seem to get the code working. So i may have messed up afterall
sunny innit
sunny innitOP2y ago
I wish XD
Kouhai
Kouhai2y ago
The code you posted here compiles normally
Denis
Denis2y ago
oh are you getting the same error?
sunny innit
sunny innitOP2y ago
I feel like im doing something wrong because when i try to run it
Denis
Denis2y ago
maybe share a screenshot of your IDE?
sunny innit
sunny innitOP2y ago
it just exits
Denis
Denis2y ago
is a part of the code highlighted in red?
sunny innit
sunny innitOP2y ago
sunny innit
sunny innitOP2y ago
no errors so it could be a logical error or something? im a noob when it comes to this, if it isnt apparent yet XD
Denis
Denis2y ago
ah I see the problem the while loop doesn't loop because your myBool is negated to false
sunny innit
sunny innitOP2y ago
oh
Denis
Denis2y ago
and while stops looping when the boolean is false remove the !
sunny innit
sunny innitOP2y ago
it works perfectly now, thanks so much friend 😄 i sat with this for like 3 hours today lol
Kouhai
Kouhai2y ago
Compile time errors are different from runtime logical errors
Denis
Denis2y ago
Don't worry, you will sit for 3 hours over many other programming problems
Kouhai
Kouhai2y ago
compile time means the program's executable won't even be created
Denis
Denis2y ago
sometimes days even....
sunny innit
sunny innitOP2y ago
i see, is there any way to see those? or are they also invisible like logical errors?
Kouhai
Kouhai2y ago
Well, compile time errors are like the one you encountered earlier CS1001
sunny innit
sunny innitOP2y ago
If i get paid to look for errors for hours/days/weeks/months then i see that as a win hahaha ooh i see I just consulted the internet once that error number came up but it didnt make me any wiser sadly but im only like ~4 weeks into a beginners programming class
Kouhai
Kouhai2y ago
Yeah, it was a weird error, because on two machines it compiled with no errors Shrug
sunny innit
sunny innitOP2y ago
perhaps i wrote something wonky on my side hahaha or something. But im glad it got fixed and now i understand what got messed up Thanks to both of you!!!!!!!!! ❤️ @Kouhai @Deno
Kouhai
Kouhai2y ago
Well, if everything is okay, don't forget to /close ThumbsUpSmile
sunny innit
sunny innitOP2y ago
Will do 🙂
Want results from more Discord servers?
Add your server