|
Since there is a problem with the brackets I will use [] for this illustration.
In the CWafer class I have declared a two dimensional array as...
array[CCoordinate, 2]^ OriginalData;
Then in the constructor I have defined it as...
OriginalData = gcnew array[CCoordinate, 2](1000, 1000);
Thanks
|
|
|
|
|
Hi,
when posting some code you could:
1. use the <pre> and </pre> tags to get background coloring, and preserve indentation
2. check the "ignore HTML tags" below the textbox to preserve the < and > that get
eaten by the HTML interpreter
but you cant expect both to work at the same time.
If you republish your code with this in mind (that's 2. I guess), more people may react
to the actual question...
|
|
|
|
|
Not having ever heard of these "tags", how do you use them?
Buck
|
|
|
|
|
These are HTML tags, they apply to whatever is in between the opening tag and the closing
tag, that is:
<pre>
for (i=0; i<10; i++) {
print (a[i]);
}
</pre>
will show as (there are four spaces to the left of print, a tab would do too):
for (i=0; i<10; i++) {
print (a[i]);
}
which is quite a difference for larger blocks of code, isnt it ?
|
|
|
|
|
Luc,
Is there a secret way to copy code FROM a post that's wrapped in "pre" tags and still retain
carriage returns when pasting to, say, Visual Studio?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
I had a discussion only yesterday about PRE and CODE tags,
and it is confusing and not satisfying.
the PRE tag seems to give non-prop font, correct spacing (except drops empty lines), background;
the CODE tag seems to give non-prop font, dark red forground color
copying while preserving newlines is completely unclear;
sometimes it works for both PRE, CODE and PRE+CODE
sometimes it does not; I do not understand
And I dont know a magic trick that solves it all.
Regards
|
|
|
|
|
I don't think pre drops blank lines:
Let me see...
Oh that's right - I had to ask about that one a while back - add at least 1 space to the line
and the line will stay - so yes, I guess it drops empty lines.
Anyway, I like the way code looks in the pre tags, I just wish I could copy the code right over
to VS. I spend enough time here so it grinds my gears when I have to go through and reformat it.
I guess I could actually research this. Nah.
Thanks!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
I fully agree.
One should be able to copy source code from VS into whatever tag is required in a message
to get it shown at its best; and to copy code from a message back to VS, without any
hassle.
AFAIK that is not the case:
1.
empty lines (without a single char) get thrown out of PRE
2.
and copying from message to elsewhere may or may not succeed (i.e. keep newlines)
3.
and then there is the problem with the < sign which triggers HTML interpretation;
if you're lucky it does not start a valid HTML tag and it will show as intended;
if unlucky it will be eaten together with some more characters
(most striking example are the summary,returns,remarks tags from structured comments in C#,
the ones that can be collected into an XML file.
Of course, there must be technical reasons for the current behavior: the message is shown
as HTML text, so we copy what we see (more or less), but we dont see what we type or paste;
nevertheless we want to be able to paste, then copy with no change whatsoever !
I'll try to do some more research on this, resulting hopefully in:
- either some guidelines as to how best to use what is available
- or a new request towards the webmaster(s)
Regards
|
|
|
|
|
Luc,
Here is an odd twist. If I am using the CPSyntax, and take the
and paste into VS, I get...
1.
2.
3.
4.
5.
This happens in Notepad, as well. Disabling CPSyntax, all is good
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Paul Conrad wrote: Disabling CPSyntax, all is good
On my laptop, I had an older version of CPSyntax. Updated CPSyntax and all is better now...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I've had some time to play with CPhog on FF. Fixed all my editor gripes
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: play with CPhog
CPHog is really cool, how about the CPSyntax? I just updated the version I had on my laptop and now it works better
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
The preformatted text off this[^] page copies fine
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Interesting, much better, but not perfect either, it still interprets <b> inside a
pre block, turning text to bold (as is normal in HTML).
I will be looking for actual CP messages with code blocks that look good and
either do or dont let them being copied while keeping newlines intact, so I can
study the source (as in "View Source" on IE).
|
|
|
|
|
|
That's what I'm talking about. I like to run code, not just try to read it, especially when an
OP posts a couple pages of code. I DON'T like having to format it so I can look at it without
my eyes bleeding
I'm waiting for Luc to figure it all out...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Luc and I went into a fair discussion about this yesterday or so. To make things more strange, I've used CPSyntax and it has made things go weird.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I'm intrigued...what is this "CPSyntax"??
Considering how much time I spend in a browser every day, I should know something about this
stuff
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
CPSyntax is a Grease Monkey script done by Shog to pretty up code in the forums. The code shows up in lines of alternating white/light bluish lines. It was nice until I noticed the copy/paste matters. I may drop Shog a note about it...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Paul Conrad wrote: CPSyntax is a Grease Monkey script done by Shog to pretty up code in the forums
That's what I thought. Cool! Thanks!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It's pretty cool, sometimes I forget I have it on the laptop and not my desktop.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Well I switched to FF after these discussions yesterday. It fixed all my code formatting and copying
gripes except for one - I wish the angle brackets would be left alone in pre formatted blocks.
Sure it's not HTML but there's very few tags supported anyway.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What about the copy/paste issue that I mentioned in the post to Luc?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
You mean with CPsyntax and the line numbers? I'm not using that so it works fine.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Now all of the sudden I see links view plainshow original copy to clipboard print ? And it works fine when using the copy to clip board. I wonder why I see it on my desktop, but not the laptop? Cool, I got something to research around on this morning
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|