Menu

Concatenation question

Help
MBB
2022-10-21
2022-10-21
  • MBB

    MBB - 2022-10-21

    I'm using version 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073 with an 18F4550.

    I am trying to concatenate bytes I read using HI2C into one long string.

    My code is:

    dim Message_Text(260)
    dim GPS_DataSTR as string

    GPS_DataSTR = Str(Message_Text(NN)) + Str(Message_Text(NN + 1)) + Str(Message_Text(NN + 2))

    When I compile it I get this error message:

    Error: Cannot handle construct. Please simplify source
    Max_M10s_d.gcb (214): Error: Cannot handle variable construct. Please
    simplify source.

    What am I doing wrong?

     
  • Anobium

    Anobium - 2022-10-21

    Great question.

    To ensure the concat does not cause an error the compiler is requesting simlification.

    Try,

    GPS_DataSTR = Str(Message_Text(NN)) + Str(Message_Text(NN + 1))
    GPS_DataSTR = GPS_DataStr + Str(Message_Text(NN + 2))

     
  • MBB

    MBB - 2022-10-21

    Thanks! That worked.

     
    • Anobium

      Anobium - 2022-10-21

      Any thoughts on how to make the message clearer? We can change with ease.

       

Log in to post a comment.