help clean up some code


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,720


    Did you find this post helpful? Yes | No

    Default Re: help clean up some code

    how does this look ?

    value var byte[6]
    chk var byte

    chknewval:
    chk=0
    while chk<6
    if value[chk] = 0 then
    value[chk]=newvalue
    chk=6
    else
    if value[chk]=newvalue then ;we already have this value
    chk=6
    else
    chk=chk+1
    endif
    endif
    end while
    return ?

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


    Did you find this post helpful? Yes | No

    Default Re: help clean up some code

    I just learned something new about PBP! (Use of [brackets]). Thanks Richard!

    Mike

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, 03: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, 21:44
  3. How can I clean up my code?
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th June 2012, 00: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, 11: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, 20: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