Jump to content
  • Advertisement
Sign in to follow this  
ronim

[.net] Untitled

This topic is 4518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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++; { 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

Share this post


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

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++;
{ // 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]

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!