+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    738

    Default SWAP COMMAND extended to Longs and array variables

    would be nice to have the swap command be extended to support longs and array variables and not limited to its current form

  2. #2
    Join Date
    Aug 2003
    Location
    Australia
    Posts
    973

    Default Re: SWAP COMMAND extended to Longs and array variables

    Hi
    It’s impossible to swap a pair of RAM locations in any language on any platform without the use of an identical sized temporary RAM location.
    The manual only means you don’t have to look at the mess in a BASIC program, but it still exists in the compiled result.

    Code:
    valuea = 3;
    valueb = 6;
    
    temp = valuea
    valuea = valueb
    valueb = temp
    
    // valuea now = 6, and valueb = 9

Similar Threads

  1. How to use array variable for shiftout command
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 11th June 2012, 10:01
  2. MIBAM and Array Variables in FOR-NEXT Loops
    By Homerclese in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th August 2010, 12:50
  3. Seeting array variables in For-Next loop
    By bcd in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th October 2007, 07:01
  4. SOUND command and variable array
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 27th March 2007, 11:56
  5. Reading Array values into variables
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 21st March 2005, 10:30

Members who have read this thread : 13

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