Multi diomencinal array


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    4

    Default Multi diomencinal array

    I'd like to create a multi dimensional array in pic basic. Is it possible? And how?
    What i mean is something like this. A var byte[9][5]
    Last edited by morphyn; - 11th February 2009 at 19:45.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    morphyn, Think about it... Just multiply one element by the other....

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    It is sort of possible in a round about way...

    This may help
    http://www.picbasic.co.uk/forum/showthread.php?t=544
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Feb 2009
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    mackrackit and dave thanks for your replies.Mackrackit, It was also something that i wonder but it won`t be usefull for my problem i guess. I have 2 variables that will help me to refer to a byte.
    For example: i will need a number from the array and i will call it via these two variables.
    Lets say what i need is something like this.
    1 10 15 20
    10 15 1 20
    20 1 10 15
    15 20 1 10
    When my x-axis of the array is 2 and and y axis of the array is 3 i will get 20.
    The value of the axis` will be defined by my variables. And the value of my variables will be up to the device that i will communicate with.(there are more than one devices so...)
    Dave, I couldn`t get what you mean. Can you give an example?

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I do not quite follow you.
    But... have you looked at a LOOKUP table?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Feb 2009
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    I guess i`ve found a solution to my problem.
    FIRSTARY VAR BYTE[7]
    SECONDARY VAR BYTE[7]
    THIRDARY VAR BYTE[7]
    ' DEFINE ARRAYS HERE...
    ROW VAR BYTE
    COLUMN VAR BYTE
    DATA VAR BYTE
    SELECT CASE ROW
    CASE 1
    DATA=FIRSTARY[COLUMN]
    CASE 2
    DATA=SECONDARY[COLUMN]
    CASE 3
    DATA=THIRDARY[COLUMN]
    ENDSELECT

    Thanks for your help guys...

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. 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
  4. RS232 receive an array (packet)
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th February 2008, 05:02
  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 : 1

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