serin DEC


Closed Thread
Results 1 to 1 of 1

Thread: serin DEC

  1. #1
    barkerben's Avatar
    barkerben Guest

    Default serin DEC

    Hi,

    I was wondering...

    If I use serin2 and dec, will the read stop when a non numeric character is received?

    For instance, if I have the following arrive at my serial port:

    A12abcd

    and I use the command SERIN2.... [WAIT("A"),dec foo]

    where foo is a byte, will foo end up with the value 12 in it? In other words, is the compiler "smart" enough to notice the following characters are non numeric?

    Also, what would happen if my input string was instead:

    A1234abcd

    1234 is too large to fit into one byte, wich is however what the code is asking for. What kind of error would this give? Would the byte just end up as 255?

    And how about if I had the following:

    Input string is:

    ABCDEFG123

    SERIN2.... [WAIT("A"),dec foo]

    The command now waits for "A", then tries to read in a numeric value, but the next character is B. Will it keep skipping characters for ever until it finds a numeric value (eventually returning 123), or just return nothing...?

    Cheers,

    Ben
    Last edited by barkerben; - 12th November 2005 at 22:22.

Similar Threads

  1. Serin EEPROM Programmer
    By dirtbiker5627 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 24th February 2010, 23:48
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  4. Serin with low voltage
    By f_lez in forum General
    Replies: 3
    Last Post: - 21st August 2006, 11:52
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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