Decimal Digit extract


+ Reply to Thread
Results 1 to 1 of 1

Thread: Decimal Digit extract1213 days old

  1. #1
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,884
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Decimal Digit extract

    Edit: Just read the description again. It does work from right to left but the example is wrong.
    I followed the example. No help needed now but les might need to change the example.
    John

    Here's my original confused post

    I must be doing something wrong but this few lines gives the reverse of the example in the manual.
    Manual P94

    MyWord = 9742
    Print MyWord ? 2 ' Display digit 2 (7)
    For Loop = 0 to 4
    Print MyWord ? Loop ' Display digits 0 through 4 of 9742.
    Next


    At least it should be 0-3 not 0-4.

    my code is:

    Password = ERead PasswordAddr where password is 973
    Password1 = password ? 0
    Password2 = password ? 1
    Password3 = password ? 2
    Print At 1,1,Dec password," ",Dec password1," ",Dec password2," ",Dec password3


    The result is 973 3 7 9
    The password is correctly read into the word variable Password and printed correctly, but the byte variables password1 etc are the wrong way around.

    To make it work I would have to do this:
    Password1 = password ? 2
    Password2 = password ? 1
    Password3 = password ? 0

    It's got to be something simple but I can't think of it.
    18F2480 at 32MHz
    John
    Last edited by John Drew; 31st January 2017 at 01:51. Reason: Realised the example in the manual was wrong

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Extract data from NMEA
    By John Drew in forum GPS
    Replies: 17
    Last Post: 31st August 2008, 02:38
  2. Binary or decimal?
    By joesaliba in forum Proton Plus Compiler v3
    Replies: 12
    Last Post: 25th August 2008, 19:59
  3. [SOLVED !] bcd to decimal
    By ADLIN SYSTEMS in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 31st March 2007, 14:24
  4. Best way to extract Integers in Float variable
    By dolci in forum Proton Plus Compiler v3
    Replies: 8
    Last Post: 18th August 2006, 20:05
  5. Free ZIP create/extract Utility
    By C H Whitehead in forum The Lounge
    Replies: 1
    Last Post: 23rd January 2005, 21:56

Tags for this Thread

Posting Permissions

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