Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    Hello. I need to have this code:

    ARRAYWRITE TEXTLINE,[DEC T5, DEC T6]

    but to make it write into last bytes of TEXTLINE array, which is 16 bytes long.

    SKIP operator is not supported for ARRAYWRITE.
    I know that I can directly write to array like

    TEXTLINE[X]=Y

    But I need to use DEC modifier, which is not supported for non-array variables.

    Any ideas?

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    Using a temporary var maybe?

    temp=dec t5

    TEXTLINE[X]=temp

    temp=dec t6

    TEXTLINE[X+1]=temp

    Ioannis

  3. #3
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    No it does not works

    A=DEC B gives "bad expression" error.

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


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    Yeah I forgot that. You have to make the calculations and then assign the value.

    Maybe others have a better idea.

    Ioannis

  5. #5
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    If you are wanting to convert to ASCii, just add $30 to numeric values. This works only for single digits 0 >> 9 though.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    The addition of $30 will not convert numeric 123 in a three byte ascii value as requested. Either way two words are not enough in the first place. For a byte you need three bytes after the conversion, so for two bytes you need total 6 bytes holding the ascii values.

    I suppose t5 and t6 are bytes. The following will read three bytes for t5 and another three bytes for t6 into temp array. If value of say t5 is 5 then the array temp will be "0","0","5" in ascii format.

    arrayread temp,[dec3 t5,dec3 t6]

    then you can transfer the 6 bytes to the place you want in the final array.

    Ioannis

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,388


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    for a 16 byte buffer going to this much trouble to format the last 8 bytes seems unproductive
    why not just format the whole thing properly in one go to start with ?
    Warning I'm not a teacher

  8. #8
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    Why update whole screen all the time, when I need only two digits to be changed?

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,388


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    Why update the buffer at all when you can do partial screen updates ?
    if the buffer is not part of the screen update process then what purpose does it serve ?
    makes little to no sense to me
    Warning I'm not a teacher

  10. #10
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Arraywrite SKIP not supported, DEC for common variable not supported, any ideas?

    The screen update routine is called once per second, according to time change, which is provided by DS3231.
    However, other subroutines are not synced to clock seconds and have own "schedule" of being called.
    So it's quite logical to have data ready, but update screen once per second.

Similar Threads

  1. Array syntax not supported
    By Scampy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th December 2015, 13:48
  2. READCODE pics supported
    By synsyn in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th June 2013, 21:52
  3. Is 10F220 supported ?
    By ruijc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th November 2009, 21:08
  4. 16F677 supported?
    By 12aBridge in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th October 2009, 03:27
  5. PIC16F687 - supported?
    By badcock in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th August 2005, 10:33

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