PLA Forums

Other Stuff That Has Little To Do With PLA => Techinical Shit => Technical Support => Topic started by: BrianOlsen on May 01, 2007, 10:49:14 PM

Title: Programming question
Post by: BrianOlsen on May 01, 2007, 10:49:14 PM
I'm wanting to use comments to explain a particular line of code and my editor is not reflecting it correctly.  Here's my comments

Code: [Select]
/+ a=b;
/+ c=d; +/
    e=a+c; +/

any help would be appreciated.
Title: Re: Programming question
Post by: Reverend Greed on May 01, 2007, 10:53:54 PM
I'm wanting to use comments to explain a particular line of code and my editor is not reflecting it correctly.  Here's my comments

Code: [Select]
/+ a=b;
/+ c=d; +/
    e=a+c; +/

any help would be appreciated.

Why is that a big deal?  Besides, you're nesting your comments.
Title: Re: Programming question
Post by: BrianOlsen on May 01, 2007, 10:56:49 PM
Because they are needed when I want to comment out a block of code which already contains comments.
Title: Re: Programming question
Post by: Reverend Greed on May 01, 2007, 11:05:36 PM
Then why not simply do this?

Code: [Select]
/+ a=b;
    c=d;
    e=a+c; +/
Or this:

Code: [Select]
/+ a=b; +/
/+ c=d; +/
/+ e=a+c; +/

It'll sure save the hassle of what your editor is doing.
Title: Re: Programming question
Post by: BrianOlsen on May 01, 2007, 11:11:22 PM
I understand that, but dealing with embedded devices - like I do all day - C is still the programming language of choice. And C knows only this /* */ comment style. // has been introduced with C++. Nevertheless most compilers nowadays support // inside a C file. And as far as I remember it's part of the newer C99 standard. But usually the old C90 standard is used.

But as you know by my /+ that I'm using D.  And D contains all three comment-outs.
Title: Re: Programming question
Post by: Reverend Greed on May 01, 2007, 11:18:05 PM
Okay,

Lets use your example with C/C++ comment styles.  According to your beginning post you basically wanted to do this:  /* /* */ */.  To me, this is pointless.  The /* */ comment is designed for debugging.  Normal comments should be made with the //.

If you comment out a block with the /* */ and want to comment out a bigger block, don't add more of them, just move the ones you have.  If the language doesn't have 2 kinds of comments, they typically only have the single line comment like REM.  If you write formatted easy to follow code, you really shouldn't have any block /* */ comments in your finished code anyway, so you'd only need that if you write ugly programs in a straight line and actually want to comment them.  Chances are if you purposely write ugly code, you don't want any comments.  If you write a nested block comment, the program should reach out and smack you.
Title: Re: Programming question
Post by: BrianOlsen on May 02, 2007, 01:11:23 AM
I see what you're saying.  Agree to disagree maybe?  I'm going to test it while debugging.  Also, I don't have a C compiler handy so I'll try tomorrow.
Title: Re: Programming question
Post by: BrianOlsen on June 04, 2007, 05:38:00 AM
Sorry for not getting back to you.  I ended up using the nested comments and just dealt with the fact that my editor did not highlight appropriately.

---------------------------------------------------------------------------

To change the subject what languages due you use to develop web apps?
Title: Re: Programming question
Post by: Reverend Greed on June 04, 2007, 08:24:12 AM
I use XUL, JavaScript, HTML, and CSS.
Title: Re: Programming question
Post by: mr_doc on June 04, 2007, 02:51:34 PM
I'm wanting to use comments to explain a particular line of code and my editor is not reflecting it correctly.  Here's my comments

Code: [Select]
/+ a=b;
/+ c=d; +/
    e=a+c; +/

any help would be appreciated.

That would comment out
a=b;
/+ c=d;
and leave you with
e=a+c; +/ uncommented

Rev. Greed is right. Delete the nested start and end comment tags and you will accomplish what you wanted.

Title: Re: Programming question
Post by: BrianOlsen on June 14, 2007, 09:21:21 PM
I'm wanting to use comments to explain a particular line of code and my editor is not reflecting it correctly.  Here's my comments

Code: [Select]
/+ a=b;
/+ c=d; +/
    e=a+c; +/

any help would be appreciated.

That would comment out
a=b;
/+ c=d;
and leave you with
e=a+c; +/ uncommented

Rev. Greed is right. Delete the nested start and end comment tags and you will accomplish what you wanted.



Yeah, he was right. I fixed it.
Title: Re: Programming question
Post by: BrianOlsen on June 14, 2007, 09:27:35 PM
Rev, you helped me out with SSI before...

I have a dynamic javascript controlled iframe that handles resizing of the iframe. I need to work that into the SSI.php file so that it calls the javascript function & loads whatever link fro SSI into the iframe.

The syntax that I would normally use to open a static link would be: href="javascript:loadintoIframe('mainframe', 'yabbse/index.php')"

I tried href="javascript:loadintoIframe('mainframe', ', $post['href'], ')" with various quote & comma options with no luck..
Title: Re: Programming question
Post by: Reverend Greed on June 14, 2007, 09:42:32 PM
Try this:

Change:

Code: [Select]
href="javascript:loadintoIframe('mainframe', ', $post['href'], ')"
To this:

Code: [Select]
<a href="javascript:loadintoIframe(\'mainframe\', \'', $post['href'], '\')">
Title: Re: Programming question
Post by: BrianOlsen on June 14, 2007, 09:53:58 PM
Damn, man.  That was it.  Did you go to school to learn this or what?  How about I just send you all my stuff for you to finish.
Title: Re: Programming question
Post by: Reverend Greed on June 14, 2007, 10:08:24 PM
Actually, I obtained a Bachelor's in Business Administration with a Marketing option.  I minored in Computer Science though. 

I self taught myself the vast majority of computer related activities.  The game, Oregon Trail, back in the early 80's was what got me fascinated with computers.  I was able to obtain the source code of that game and studied it like no other.

All in all, I wasn't about to spend thousands of dollars to major in Computer Science when I already knew the entire curriculum.
Title: Re: Programming question
Post by: BrianOlsen on June 16, 2007, 09:44:37 PM
That's cool.  I'm in college right now taking some computer courses.  I need your help again but I will start a new thread.