Fixing percent sign when posting code.


Closed Thread
Results 1 to 19 of 19
  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517

    Default Fixing percent sign when posting code.

    Hi,
    This has been mentioned several times now but I'll bring it up again since it's still a big problem.

    When posting code between code tags and including binary numbers like ADCON=101011 the forum tends to remove the percent sign and some of the digits. It doesn't happen all the time:
    Code:
     ADCON=%101011   'same as above
    but it sure does happen a lot - for example here, here and here (and that's just the last couple days) but, for example, NOT in this post.

    What is going on? This issue really needs to be looked into IMHO.

    /Henrik.

    EDIT: Look it happend to me in this post. The thing is that at first it was fine, then I went into EDIT the post and after "reposting" it i was messed up.
    Last edited by Ioannis; - 15th June 2012 at 08:30.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Henrik, I edit your post and placed the missing sign.

    How?

    Simply by clicking the first A/A button on the edit window (Switch Editor to Source Mode).

    Ioannis

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Hi,
    Yes, it can be fixed by editing, editing and editing, switching between different modes and more editing - there really should be no need to.

    And, even if you went in and added the % sign in my previous post there's still an issue with the lost digits.

    Can the editors then be set to default to the correct mode? It seems that when first making the post it defaults to the one where % works (because at first it WAS there) but when editing posts it defaults to the one where % does not work (because after I edited my post it was gone).

    People come here for help, they post their code for other members to look at and the forum messes it up. It gets hard for people to help. IMHO this is a real issue which has a bad impact on the usability of the forum.

    /Henrik.

    EDIT: Oh, look at my original post. Now the % sign and leading digits are gone from the text as well, not only the code window. It's just a mess this....

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Well, the default is WYSIWYG, and as I understand it this should show the % sign. So it is not very much what I see...

    This is Lesters job and not moderators thing to mess.

    Uers just have to remember click on the A/A button prior to write the message.

    Ioannis

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Testing:
    Code:
    ADCON = 101010
    The above was written in the WYSIWYG editor which, at least for me, is the default editor when making a new post.

    EDIT:
    That showed up OK. Now I pressed Edit post, the editor looks different but the A/A button says Switch to Source mode so I guess I'm still in WYSIWYG mode.
    Code:
    ADCON = 101010
    EDIT2: And that messed it up.
    Last edited by HenrikOlsson; - 15th June 2012 at 10:52.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    This is WYSIWYG mode:

    Name:  wysiwyg.png
Views: 664
Size:  2.0 KB

    And this is Source mode:

    Name:  source mode.png
Views: 651
Size:  2.3 KB

    When the second is selected, the percentage sign is shown.

    Ioannis

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    At the top-right of the page, click on Settings.

    In the My Settings section on the left, go to General Settings.

    Scroll down to the "Miscellaneous Options".

    For the "Message Editor Interface:" select the Standard Editor.

    At the bottom of the page, click Save Changes.

    Your default editor will now be "Source mode".

    This could be made the forum default, but it would only apply to new users when they first join.
    Each existing user will have to change the setting themself.
    Depending on the forum permissions, this may not be available for everyone.

    Please report if it is, or is not available to you.
    DT

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Thanks Darrel, it works fine.

    Ioannis

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Thanks Darrel!
    Just did that, now let's see what happens
    Code:
    ANSEL=%00101101
    EDIT: The above looked fine when first posted. Now I'm editing the message, it still looks OK in the editor.
    EDIT2: And after the edit it still seems to be OK. Lets hope everyone here sees this and make the change to their profile because more and more "messed up" code gets posted.

    /Henrik.
    Last edited by HenrikOlsson; - 15th June 2012 at 22:12.

  10. #10
    Join Date
    Apr 2003
    Location
    Cambridge - UK
    Posts
    1,030


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    If required, i can set ALL users to default to the standard editor.

    just let me know, if that's the group decision.

  11. #11
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Thanks Lester!
    I'm just one member but I think it's a good idea doing that.

    /Henrik.

  12. #12
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    I vote to make it the default
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  13. #13
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Also vote to make it default!
    Shawn

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Before I vote, what are the cons?

    Ioannis

  15. #15
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Quote Originally Posted by Ioannis View Post
    Before I vote, what are the cons?

    Ioannis
    The only con I see, is that the code posts won't be as neat, and will lose some formatting. But I think that sure beats losing content, like the first 2 msb after each % sign.

    I think it all started when we had a wish for neat code ...... http://www.picbasic.co.uk/forum/showthread.php?t=15475


    If we default all users to the standard editor, people that really loved the wysiwyg editor could still select it, making it a win/win.
    Last edited by ScaleRobotics; - 17th June 2012 at 20:41.
    http://www.scalerobotics.com

  16. #16
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Test for code appearance

    Code:
    label:
        for i=1to 10
            k=k+1
        next i
    With a little more effort (selecting Courier New) I think code looks OK.

    Ioannis

  17. #17
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Due to popular demand, Lester has changed everyone's settings to use the standard editor as default. The wysiwyg editor ("what you see is what you get" .... well almost!) can still be selected by those that want it.

    The wysiwyg editor was cutting off the first two bits after each %. I think there were a couple of other odities as well. If you still with to use the wysiwyg editor, it is still available. Just click on settings, select general settings, and mark the box for the editor of your choice. If you want to keep the standard editor, of course, you don't have to do anything.

    Name:  wysiwyg.png
Views: 716
Size:  44.7 KB
    Last edited by ScaleRobotics; - 19th June 2012 at 01:13.
    http://www.scalerobotics.com

  18. #18
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    It seems that the WYSIWYG setting has no affect.

    The "Quick Reply" editor is always "Source Mode", and there's no button to switch to WYSIWYG.
    But if you click the "Go Advanced" button, the editor is still in Source Mode, but there's a button for WYSIWYG.
    It doesn't seem to matter which way the setting is.

    Well, except for the "Basic Editor".
    You don't want to select the Basic Editor.

    So all in all, it works for me.
    DT

  19. #19
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Fixing percent sign when posting code.

    Oops, I guess you're right. Currently you don't really get a choice, it just looks like you do.
    http://www.scalerobotics.com

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts