The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Years and years ago I can remember putting data into REM statements in order to save memory.
Then poking and peeking things. In those days we didn't have very much memory really. So I am surprised that I remembered it at all.
A REM statement was called a remark in those days and now is more commonly referred to as a comment statement.
I had Visual Studio 2017 open in a VB.Net Winform Project and just typed "REM This is a comment" and what the elephant it went green and thus was treated as a comment statement. I was shocked. Never knew that you could do that.
OK that was just after the class declaration so tried it within the code and the intellisense wouldn't allow it.
Wanting to and changing it to RemoveHandler as soon as you entered the space after the REM.
However If I pasted it there it would immediately accept it as a comment statement.
I can understand that there is some requirement for backward compatibility, but, really, this is ridiculous.
However sort of historically wonderful as well.
So I also opened up a C# project and tried some old C stuff and this is also in there.
/* this is a
It all turned green.
It is actually better than just typing // on every line as it auto inserts the * until you terminate it with a */
This was accepted any where I typed it. Didn't know about this either.
Again seems a bit ridiculous but sort of nice.
Sometimes you learn from doing daft things.
(Maybe everyone else knew about this. I didn't)
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
I knew about /* */ for C#. That multi-line comment style has been picked up by numerous languages because it can be so helpful to block comment code.
I didn't know about REM still being accepted, but I guess that makes sense.
Here is VBA code from an Excel spreadsheet I just opened up to try it out.
Rem this is a test
Rem you shouldn't really be seeing this' these are the comments that vba seems to expect
MsgBox ("rem alert")
That's funny too, because in Excel the Rem statements turn green (as you said) and they are recognized as comments, but the code parser here on the site doesn't seem to recognize those statements as comments.
You can turn off the auto-generated single asterisk in tools/settings.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
I never used a REM statement in my batch/command scripts. I use :: for this purpose. REM still parses the entire line while :: is a label and the parser stops at the end of the label. You can't jump to :: so it works as a REM while at the same time being significantly faster.