Click to See Complete Forum and Search --> : copying vbcode from posts
westconn1
Oct 19th, 2007, 08:56 AM
if you get annoyed at the line numbering in the vbcode boxes when copying to paste elsewhere
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
Monkey007
Oct 19th, 2007, 09:37 AM
dam thats a good idea, sick to death of the rsi-deleting needed when using posted code!
Hack
Oct 19th, 2007, 09:39 AM
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.
Monkey007
Oct 19th, 2007, 09:45 AM
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
techgnome
Oct 19th, 2007, 10:01 AM
What place holders?
-tg
Monkey007
Oct 19th, 2007, 10:03 AM
HIGHLIGHT and QUOTE and all the [ and ] bits
Hack
Oct 19th, 2007, 10:11 AM
Oh please, you don't copy those, you just copy what is in between them.
Monkey007
Oct 19th, 2007, 10:20 AM
Down to preference then, I prefer the code way, saves me clicking off the post too
Al42
Oct 26th, 2007, 05:14 PM
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.)
si_the_geek
Oct 27th, 2007, 12:27 PM
Actually it isn't mine, it's Marty's:
http://www.vbforums.com/showthread.php?t=458328
http://www.vbforums.com/showthread.php?t=458438
(I personally use the Quote & copy method)
Edgemeal
Oct 29th, 2007, 07:41 PM
Nice and simple westconn1!
Just needed to add, dim i as...
birthjay
Dec 4th, 2007, 08:49 AM
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.
si_the_geek
Dec 4th, 2007, 09:21 AM
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..
birthjay
Dec 6th, 2007, 08:55 AM
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!
si_the_geek
Dec 6th, 2007, 11:56 AM
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.
Dave Sell
Feb 22nd, 2008, 01:19 PM
Pressing [QUOTE] and copy/paste works well, thanks!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.