Sign in to follow this  
ronim

[.net] Untitled

Recommended Posts

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]; i++; { if(i < s.Length && (substr == "/")) { if(i < s.Length && (s[i]== '*')) { do { substr += s[i]; i++; } while (i < s.Length && substr== "*/"); rTB2.Text += "Komentar - " + substr + "\n"; substr = ""; } ----------------- case '"': { do { substr += s[i]; i++; } while (i < s.Length && s[i]!='"'); 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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yikes! Looking at that code is giving me a headache. Try putting it inside some source brackets.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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];
i++;
{ // WHAT DOES THIS BRACKET BELONG TO?
if(i < s.Length && (substr == "/"))
{
if(i < s.Length && (s[i]== '*')) // WHY R U CHECKING s.Length AGAIN?
{

do {
substr += s[i];
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];
i++;
} while (i < s.Length && s[i]!='"');

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this