Clearing info in an array


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2005
    Posts
    14

    Default Clearing info in an array

    Is there a way to clear data in an array with one instruction? I get tired of spending code space and time on creating a loop to clear the array cells one at a time.

    John P

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    How many different array you have?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Dec 2005
    Posts
    14


    Did you find this post helpful? Yes | No

    Question Clearing info in an array

    Currently in my program I am creating the first array of only 8 bytes (x255), but that will expand depending on ease of operation and speed. I'd like to be able to clear the the whole 8 byte array with one command.

    I thought that where the array

    DPA var byte [8]

    was used that I'd be able to clear the whole array by using

    DPA = 0

    but that doesn't work.

    John P
    Virginia Beach, Virginia USA

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Doesn't the CLEAR command (manual section 5.8) work for you?

    That will ZAP everything... otherwise it's a FOR...NEXT loop if you want to be pickky.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. Array values changing
    By MyBuddy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th October 2009, 23:13
  4. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  5. RS232 receive an array (packet)
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th February 2008, 05:02

Members who have read this thread : 1

You do not have permission to view the list of names.

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