WRITECODE stores wrong 14-bit word values in FlashMEM


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Location
    San Antonio, Texas
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Looking at 4.5 Arrays in the manual it looks like you need to redefining your element from word[2] to word[3]

  2. #2
    Join Date
    Jan 2009
    Location
    Delaware
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Array variables and my lack of knowledge

    Quote Originally Posted by Dick M View Post
    Looking at 4.5 Arrays in the manual it looks like you need to redefining your element from word[2] to word[3]
    Thank you, Dick M. Could it be this simple?
    In the manual example in section 4.5 it reads:

    " shark VAR BYTE[10]
    fish VAR BYTE[8]
    The first array location is element 0. In the fish array defined above, the elements are numbered fish[0] to fish[7] yielding 8 elements in total."

    Gee, I had previously thought that the highest element would be #7, therefore expecting the highest number element to be used in the VAR definition. After rereading the manual (how many times did I already read the manual on this, yet I missed it), it SURE LOOKS LIKE I HAD IT ALL WRONG!!!!!

    Wow, all this struggling. How annoying it will be to find out that I declared my array VARs incorrectly. Of course, it would have been nice if the COMPILER would have reported an error, but I still feel like such a dunce. I will try it again and report back. MANY thanks, Dick M!
    Bob

    Now I must go back to PBP and try it all again!

  3. #3
    Join Date
    Jan 2009
    Location
    Delaware
    Posts
    19


    Did you find this post helpful? Yes | No

    Default PBP array are "dimensioned" differently that other BASICs

    Well, I checked my understand of dimensioning arrays in other forms of BASIC. In other BASICs,
    DIM fish(20)
    creates an array of 21 elements (0 through 20). Hence, the source of my confusion.

    In PBP:
    fish VAR WORD[20] has 20 elements (0 through 19).

    Getting smarter as I go.

    Bob

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 08:55
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 08:25
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th July 2008, 00:19
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 22:01
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 16:23

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