Variable not getting value from array...?


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Variable not getting value from array...?

    I think it's because WRITE defaults to BYTE variables. Sine you're using WORDs you need to tell it to write WORDs. Same thing with READ.

    /Henrik.

  2. #2
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: Variable not getting value from array...?

    That's correct Henrik.


    WRITE Address,{WORD}{LONG}Value

    WRITE mem_index, WORD temp
    Regards,
    TABSoft

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: Variable not getting value from array...?

    Hmm, OK, it was in front of me... Reading again and again...

    I was sure that my var's were WORD sized so I felt OK.

    Have not tried it yet, but seems obvious now.
    Thanks a lot.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: Variable not getting value from array...?

    Well I for one don't see where mem_index is being set. Also the commands

    write mem_index,temp
    write 0,mem_index

    would by default be writing over the contents of memory location 0 if mem_index is not set.
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: Variable not getting value from array...?

    Dave thanks for the reply. It is been set previously, I just did not paste that part too.

    Ioannis

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. Variable in array
    By Gusse in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd February 2009, 19:46
  3. SOUND command and variable array
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 27th March 2007, 11:56
  4. Array to simple Variable converting
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2006, 16:44
  5. Maximum variable array ?
    By Keith55555 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th May 2004, 14:29

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