C
C#16mo ago
sunny innit

✅ 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
Kouhai16mo ago
If possible, show your code
sunny innit
sunny innit16mo ago
would a screenshot suffice? or what would you prefer?
Kouhai
Kouhai16mo ago
Yeah sure
Denis
Denis16mo ago
$code
MODiX
MODiX16mo 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 innit16mo ago
BlazeBin - aenkmzogoqag
A tool for sharing your source code with the world!
Denis
Denis16mo ago
it was easier to paste the code here :p
sunny innit
sunny innit16mo ago
Hahaha i can do that too, i just feel like it would be cluttery
Kouhai
Kouhai16mo ago
If the code is exactly the same as you've posted, it should compile
sunny innit
sunny innit16mo ago
i cant run it at all sadly
Denis
Denis16mo ago
Do not use any special characters in code
sunny innit
sunny innit16mo ago
Denis
Denis16mo ago
by that I mean the accented O in Ovning
Kouhai
Kouhai16mo ago
surprisingly this compiles on my machine Laugh
sunny innit
sunny innit16mo ago
o_o maybe i should try creating a new project or something?
Kouhai
Kouhai16mo ago
But yeah, Denis is probably right
Denis
Denis16mo 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 innit16mo ago
i changed it to "Ovning" and its still not working 😮
Denis
Denis16mo ago
Try creating a new project with a better name maybe that helps
Kouhai
Kouhai16mo ago
The project name shouldn't show this error
Angius
Angius16mo 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 innit16mo ago
Hahaha i created a new project and made the name more arbitrary in english and the error disappeared
Denis
Denis16mo ago
😎 case closed
sunny innit
sunny innit16mo ago
What compiled for you? I cant seem to get the code working. So i may have messed up afterall
sunny innit
sunny innit16mo ago
I wish XD
Kouhai
Kouhai16mo ago
The code you posted here compiles normally
Denis
Denis16mo ago
oh are you getting the same error?
sunny innit
sunny innit16mo ago
I feel like im doing something wrong because when i try to run it
Denis
Denis16mo ago
maybe share a screenshot of your IDE?
sunny innit
sunny innit16mo ago
it just exits
Denis
Denis16mo ago
is a part of the code highlighted in red?
sunny innit
sunny innit16mo ago
sunny innit
sunny innit16mo 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
Denis16mo ago
ah I see the problem the while loop doesn't loop because your myBool is negated to false
sunny innit
sunny innit16mo ago
oh
Denis
Denis16mo ago
and while stops looping when the boolean is false remove the !
sunny innit
sunny innit16mo ago
it works perfectly now, thanks so much friend 😄 i sat with this for like 3 hours today lol
Kouhai
Kouhai16mo ago
Compile time errors are different from runtime logical errors
Denis
Denis16mo ago
Don't worry, you will sit for 3 hours over many other programming problems
Kouhai
Kouhai16mo ago
compile time means the program's executable won't even be created
Denis
Denis16mo ago
sometimes days even....
sunny innit
sunny innit16mo ago
i see, is there any way to see those? or are they also invisible like logical errors?
Kouhai
Kouhai16mo ago
Well, compile time errors are like the one you encountered earlier CS1001
sunny innit
sunny innit16mo 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
Kouhai16mo ago
Yeah, it was a weird error, because on two machines it compiled with no errors Shrug
sunny innit
sunny innit16mo 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
Kouhai16mo ago
Well, if everything is okay, don't forget to /close ThumbsUpSmile
sunny innit
sunny innit16mo ago
Will do 🙂