Is this possible?


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136


    Did you find this post helpful? Yes | No

    Default Posting code

    Darrel T

    I've noticed that when you post code here it is always neatly laid out - upper/lower case correct and tidily tabbed.

    When I cut/pase code here it looks a mess - the upper/lower case is what I typed and the tabs go adrift.

    How to you do it?

    Regards Bill Legge

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


    Did you find this post helpful? Yes | No

    Default

    Seems I remember asking Melanie that very question some 6-7 years ago.
    Her answer was a little different, but this is what I do now.
    1. Never use TAB's. And set the editor to insert 4 spaces when you hit the tab key.
      <br>
    2. Set the right gutter to 76 and don't go past it.
      Gets rid of bottom scrollbar in code box.
      <br>
    3. Turn off the "Reserved Word Formatting" and capitalize things like FOR, SELECT, LCDOUT etc. as you type them in.
      <br>
    4. copy&paste variable names and labels, don't type them in each time.
      It helps to have a fast "Flywheel" on your mouse when copying.
      <br>
    5. And for those special occasions, highlight the code with this.
      http://www.darreltaylor.com/files/Sh...IC%20Forum.htm
    <br>
    hth,
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Turn off the "Reserved Word Formatting" and capitalize things like FOR, SELECT, LCDOUT etc. as you type them in.
    <br>
    Well, I have a question on this. DEFINEs should be in capital letters. If the capitalize in MCS is enabled, will the defines be in real capital characters? If the setting is returned to default, I notice that the keyword DEFINE is showed as define.

    Will this introduce a problem in the compiler?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Contrary to popular belief, the word "define" does not have to be all caps.
    DEFINE is a PBP statement, and PBP is NOT case sensitive.

    If you are using PM.exe, then none of it has to be in caps, because PM.exe is NOT case sensitive either.

    But, if you are using MPASM ... then what you are defining does have to be all caps.

    DEFINE OSC 20 <-- OK
    define OSC 20 <-- OK
    DEFINE Osc 20 < NOT correct


    And when MicroCode Studio changes the capitalization, it only changes the way it's displayed on-screen.
    It still saves it to the file with the same capitalization you typed in.
    If you copy and paste to the forum, you get what you typed, not what it looks like in MCS.

    Any changes that MCS makes, will not affect the way it compiles, because the compiler never see's those changes.

    hth,

    P.S. If you turn off case sensitivity for MPASM, then you don't have to capitalize anything.
    Last edited by Darrel Taylor; - 28th January 2010 at 11:21. Reason: p.s.
    DT

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Or just code with cap lock on
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    The following paragraph is from the 2008 year manual of the PBP.

    "These definitions must be in all upper case, exactly as shown. If not, the
    compiler may not recognize them. No error message will be produced for
    DEFINEs the compiler does not recognize"

    After Darrels post, re-reading this paragraph, made me realize that indeed the word define can be either in capital or small. The definitions, and not the DEFINEs, must be in all upper case.

    OK. Thanks.

    Ioannis

Members who have read this thread : 0

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