copying vbcode from posts
if you get annoyed at the line numbering in the vbcode boxes when copying to paste elsewhere
vb Code:
Sub Main()
Dim myarr() As String
myarr = Split(Clipboard.GetText, vbNewLine)
For i = UBound(myarr) To 0 Step -1
If IsNumeric(myarr(i)) Then myarr(i) = ""
Next
Clipboard.Clear
Clipboard.SetText Replace(Join(myarr, vbNewLine), vbLf & vbCr, "")
End Sub
make a project with the above code (no form needed) and compile
copy from the post
run program (nothing visible happens)
paste into whatever code window
Re: copying vbcode from posts
dam thats a good idea, sick to death of the rsi-deleting needed when using posted code!
Re: copying vbcode from posts
Moved to the CodeBank
You don't need to do any deleting or formatting.
If you want a piece of highlighted code, click the quote button. The post you are "quoting" will be displayed in plain text. Just copy the code and then cancel out of the quote.
Re: copying vbcode from posts
true.. but doing it that way you get stuck with place holders you need to remove, westconn1s way has none .. guess it depends on how lazy you are.. and I am lol
Re: copying vbcode from posts
Re: copying vbcode from posts
HIGHLIGHT and QUOTE and all the [ and ] bits
Re: copying vbcode from posts
Oh please, you don't copy those, you just copy what is in between them.
Re: copying vbcode from posts
Down to preference then, I prefer the code way, saves me clicking off the post too
Re: copying vbcode from posts
Si_the_geek's VBCode program works even faster. Highlight the code you want to copy and copy it with Alt-C. (I have the program running on startup.)
Re: copying vbcode from posts
Re: copying vbcode from posts
Nice and simple westconn1!
Just needed to add, dim i as...
Re: copying vbcode from posts
Why not just have the forum guys fix the problem. Take those line numbers out. What is the point of them anyway? We used to be able to copy and past code from the forum with no problems.
Re: copying vbcode from posts
It's not as simple as that unfortunately - the current version of the forum software does not support our our old highlighting method, and there aren't options for how the current one works.
The current method is a decent replacement, even with this relatively minor issue. The development team had various issues to deal with here when we upgraded, and finding/implementing that highlighter was more than they were required to do (they could have just left us with Code tags). As they work on multiple sites (including about 30 forums) which have their own issues, something like this isn't at the top of their list.
There is work in progress to modify the highlighter to deal with the line numbers (and other minor issues such as colours), but as it not overly simple, and is being done by a moderator (thus voluntarily), it is not something which will happen immediately - but hopefully will be complete in the near future..
Re: copying vbcode from posts
I can understand that. This looks like VBulletin forum software. I primarily use PHP forum software which is open source and customizable..but does have draw backs. Perhaps the VBulletin folks can address the issue. It is a big deal in particular for this forum in which programmers indeed like and need to cut and paste code samples quite frequently. That is just my 2 cents. This has always been a great forum...so don't take this as a complaint in a broad regard.
Thanks!
Re: copying vbcode from posts
It is vBulletin (see the section at the bottom of the page), and it is customisable.. which is why the syntax highlighter (provided by someone else) is available. The issue is with the flexibility of the highlighter, rather than the forums software itself.
The problem is that while language specific code tags are certainly useful to us, they are not essential (as the standard Code tags could be used - like on many other sites). As such they are not a top priority for the team who keep this site (and several others) operational; we were lucky they did as much as they have done - as they weren't required to do it.
I understand and agree that the current issues are annoying, but they are not a "must fix", as there are various workarounds like the ones above.
As I said tho, the implementation is being "corrected" by a volunteer (who has lots of relevant knowledge/experience in this area), and will be hopefully be updated fairly soon.
Re: copying vbcode from posts
Pressing [QUOTE] and copy/paste works well, thanks!