STR array


+ Reply to Thread
Results 1 to 3 of 3

Thread: STR array

  1. #1
    Join Date
    Dec 2021
    Posts
    9

    Question STR array

    Hello

    i try to use str array with array start point at i2cwrite and i got compiling error.

    Example:
    I2C var byte[128]
    I2C_C var byte
    Cell var byte ;start point of the array

    I2C_C=32
    Cell=32

    i2cwrite sda2,scl2,%10100000,Eaddress,[str I2C[Cell]\I2C_C],ASKfail
    if i use "[Cell]" i got error- (4150): "STR" modifier can only be used with a variable

    if i use "Cell" (start point of the array) on debug or hserout or arraywrite it work fine
    hserout [str I2C[Cell]\I2C_C]
    debug str I2C[Cell]\I2C_C
    arraywrite I2C[Cell],[x.x.x.x......]

    Has anyone met with this problem?

    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,038


    Did you find this post helpful? Yes | No

    Default Re: STR array

    The correct syntax of the STR in the command is STR I2C\count.

    So what you are trying to do, send after specific point, 32 bytes of data, will not work.

    Use a temp array to transfer the data you want and then use the I2CWrite command. See page 162 of the manual.

    Ioannis

  3. #3
    Join Date
    Dec 2021
    Posts
    9


    Did you find this post helpful? Yes | No

    Post Re: STR array

    Quote Originally Posted by Ioannis View Post
    The correct syntax of the STR in the command is STR I2C\count.

    So what you are trying to do, send after specific point, 32 bytes of data, will not work.

    Use a temp array to transfer the data you want and then use the I2CWrite command. See page 162 of the manual.

    Ioannis
    Thanks for your reply.

    of course i solved it in other way.
    the purpose was to make it easier :-).

    attached the code i made, it working perfect.
    ExternalEepromWrite.txt

Similar Threads

  1. STR ArrayVar question
    By MikeRant in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th May 2011, 23:01
  2. HSERIN and STR - character encoding
    By boban in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 13th August 2008, 18:36
  3. Help with STR ArrayVar\n\c with SerIn2
    By leinske in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 15th May 2006, 02:04
  4. Serin2 and STR Modifier
    By _Ian in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 22nd June 2005, 17:25
  5. STR function blues...
    By bearpawz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th October 2004, 03:10

Members who have read this thread : 9

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts