Announcement

Collapse
No announcement yet.

Request: Posting source codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Request: Posting source codes

    Many of yours faced with troubles in selecting/copying long source lines.
    You must move your mouse while selecting lines very accurate, otherwise you'll select a whole thread and etc..
    This issue and others like selecting source codes already been discussed, but I think that converting the code inside CODE tag into a local file on server would be better solution. It shouldn't be hard to implement.

    Here are the simple scenario of this new feature:
    1. User creates a new thread or add new post and pasting source code into a CODE tag.
    2. Once editing finished and Create New Post or Reply buttons clicked, server gets content of CODE tag and generates text file on server
    using following format: [threadId]-[PostId].txt - That's guaratees no duplicated filenames will be generated on server side.
    3. When server will finish the conversion, user get the page with attached code in text format.

    IMO, It is not necessary to generate text files if count of lines less than 50 or 100 lines..

    The benefits of new feature are:
    1. Source code selections replaced with simple downloading of text files
    2. Donwload source code directly into local folder with required extention .bas, .inc, .rc etc
    3. Less traffic used to download whole page with bigger source codes
    4. The size of html pages generated for thread/post will be smaller
    (html page with code tags will be smaller than page with link to a file)
    5. Unique filenames on server
    6. No Zip/Unzip required

    Cheers,
    Aslan.

  • #2
    I am of the exact opposite opinion.

    Sometimes it is very useful to see the code before you download it, especially in the Source Code forum so you know what it is you are looking at before you use it. I would prefer code not be as attachments as I then cannot tell if it is what I am actually looking for.

    Just an FYI...

    To copy and paste the whole CODE block just hold down the CTRL key and left click just to the left (outside) the CODE block box...that will select all the text. Works in Inernet Explorer, not sure about other browsers. Can't get much simpler then that.
    Last edited by George Bleck; 9 Nov 2009, 06:11 AM.
    <b>George W. Bleck</b>
    <img src='http://www.blecktech.com/myemail.gif'>

    Comment


    • #3
      Bummer - the trick didn't work in Firefox and I couldn't find a similar trick on the web anywhere.

      Comment


      • #4
        This forum is driven by vBulletin forum which I do not know but I know that other forum software when Code is posted, automatically add few tille button used to "Select all" or "Expand" or "Copy" the content of the Code block.

        For example, phpbb has a "SELECT ALL" JavaScript code. Example: http://www.phpbb.com/community/viewt...4453&start=525

        Maybe also vBulletin has this option or it can be added using a customized option.
        thinBasic programming language
        Win10 64bit - 8GB Ram - i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

        Comment


        • #5
          Someone already asked in vBulletin: http://www.vbulletin.org/forum/showt...ight=code+copy
          thinBasic programming language
          Win10 64bit - 8GB Ram - i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

          Comment


          • #6
            May not be perfect, but if you're copying a lot of code from the forum, may be beneficial...

            http://www.powerbasic.com/support/pb...ad.php?t=35818
            Adam Drake
            PowerBASIC

            Comment


            • #7
              new addition to my suggestion:
              + add button [Show Source code]. That will open a new window with source code only. This window can be re-used on every click at different posts.

              Comment


              • #8
                One thing that would be a must with attachments is that they must be indexed.

                If the board does not index the attachments you will not find specific source code fragments by searching for keywords.

                BTW I am still whole hearrtly against hiding the source code. When you search for something you want to be able to see and review it quickly to make sure you are finding what you want. If you constantly have to click a button to review the hidden code it becomes a bear.
                Last edited by George Bleck; 10 Nov 2009, 12:32 PM.
                <b>George W. Bleck</b>
                <img src='http://www.blecktech.com/myemail.gif'>

                Comment


                • #9
                  if indexing is an issue, then probably better solution would be adding an extra button on top or bottom to source code text boxes to open a src code in new window... of course, not all source codes requires such capability, only codes where count of lines more than 100 or 150.

                  Comment


                  • #10
                    Originally posted by Aslan Babakhanov View Post
                    Many of yours faced with troubles in selecting/copying long source lines.
                    You must move your mouse while selecting lines very accurate, otherwise you'll select a whole thread and etc..
                    It might be easier if you switch to the printable view of the thread.

                    Another trick is to select only the first few characters with the mouse. Once you have done that, hold down the SHIFT key and press the down arrow key until you have selected everything you want.
                    Erich Schulman (KT4VOL/KTN4CA)
                    Go Big Orange

                    Comment


                    • #11
                      I usually either click at the beginning of the source or drag my mouse to select some characters at the start of the source and then scroll to the bottom and shift click at the end of the source to select it all. Then it is simply a copy in the browser and a past into the PB IDE.
                      Jeff Blakeney

                      Comment


                      • #12
                        Internet browsers behaves differently. I'm using mostly Opera and must say that trick to copy source code in v.9 doesn't work in v.10...

                        Comment


                        • #13
                          Internet browsers behaves differently.
                          Besides IE and FF, have you tried Safari or Flock?
                          I'm impressed with Safari, simply because it's pretty straight forward and I haven't had any issues with anything I've attempted.
                          Flock is a FF offspring that is geared towards the social programs (Facebook, Bebo, etc.). Don't know much about it.
                          Rod
                          In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                          Comment

                          Working...
                          X