help clean up some code


Results 1 to 11 of 11

Threaded View

  1. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: help clean up some code

    Here's what I'd do:
    if counter = 1 and value0 <> newdata then
    value1 = newdata
    counter = counter +1
    return
    endif
    if counter = 2 and Value0 <> newdata and Value1 <> newdata then
    value2 = newdata
    counter = counter + 1
    return
    endif" .......

    There is probably a clean "select case" application here as well.

    Mike
    Last edited by mpgmike; - 7th April 2014 at 23:31. Reason: code error

Similar Threads

  1. Serial problem between BasicStamp code and PBP code
    By AllanZilkowsky in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 6th April 2014, 02:15
  2. Working code but my layman approach uses too much code space
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th December 2012, 20:44
  3. How can I clean up my code?
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th June 2012, 23:34
  4. How to drop from 6V to 5V a "clean" way?
    By flotulopex in forum Off Topic
    Replies: 20
    Last Post: - 10th October 2007, 10:03
  5. Code: Why is this code greater than 2000 words?
    By DrDreas in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st June 2007, 19:51

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