[.net] Untitled

Started by
5 comments, last by Machaira 18 years, 1 month ago
I've got some problems parsing strings and /* */ comments. Any help will be appreciated. ----------------- // multyline comments case '*': case '/': case '(': case ')': case '+': case '-': case '=': case '~': case '|': case ';': case '%': case '&': case '{': case '}': case ',': case '[': case ']': case '?': case ':': case '^': case '<': case '>': case '!': case '.': substr += s; i++; { if(i < s.Length && (substr == "/")) { if(i < s.Length && (s== '*')) { do { substr += s; i++; } while (i < s.Length && substr== "*/"); rTB2.Text += "Komentar - " + substr + "\n"; substr = ""; } ----------------- case '"': { do { substr += s; i++; } while (i < s.Length && s!='"'); rTB2.Text += "Tekst - " + substr + "\n"; substr = ""; } brake; ----------------- If someone want, here is a direct link to my code. http://www.geocities.com/puma55555/MyC.zip
Advertisement
Quote:Original post by ronim
I've got some problems parsing strings and /* */ comments. Any help will be appreciated.

< snip >

} brake;

You've got more problems than just parsing. [headshake] [oh]

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Yikes! Looking at that code is giving me a headache. Try putting it inside some source brackets.
OK, you see that i'm not a master, but will appreciate any help. I don't think the code is so difficult or bad writed to give you a headache. Anyway, still searching for some help.
Quote:Original post by ronim
OK, you see that i'm not a master, but will appreciate any help. I don't think the code is so difficult or bad writed to give you a headache. Anyway, still searching for some help.


Sorry Ronim. My intentions were not to offend you. If you put source tags around your code, it'll be easier to look at in the forums. Here, I'll do it...

// multyline comments// WHERE'S THE SWITCH VARIABLE?case '*': case '/': case '(': case ')': case '+': case '-': case '=':case '~': case '|': case ';': case '%': case '&': case '{': case '}':case ',': case '[': case ']': case '?': case ':': case '^': case '<':case '>': case '!': case '.': substr += s;i++;{  // WHAT DOES THIS BRACKET BELONG TO?if(i < s.Length && (substr == "/")){    if(i < s.Length && (s== '*'))  //  WHY R U CHECKING s.Length AGAIN?    {        do {             substr += s;            i++;        } while (i < s.Length && substr== "*/");        rTB2.Text += "Komentar - " + substr + "\n";        substr = "";    }//  R U MISSING A CLOSING BRACKET HERE?-----------------case '"': { //  DON'T THINK YOU NEED THIS BRACKET    do    {        substr += s;        i++;    } while (i < s.Length && s!='"');    rTB2.Text += "Tekst - " + substr + "\n";    substr = "";} //  ...OR THIS BRACKET    brake;


What's your switch variable and what errors are you getting?

I added some additional comments/questions in your code in CAPS!

[Edited by - slowmike on March 7, 2006 1:12:38 PM]
I dont know how u put all the code in a block so i give u a link to a TXT file, containing all the code of my button.

http://www.geocities.com/puma55555/Form1.txt
Quote:Original post by ronim
OK, you see that i'm not a master, but will appreciate any help. I don't think the code is so difficult or bad writed to give you a headache. Anyway, still searching for some help.


You haven't told us what the problem is yet.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

This topic is closed to new replies.

Advertisement