Arrays and strings are not the same.
You want to avoid using too many strings because all strings are allocated the same STRING_MAX_LENGTH storage
For handling incoming UART RX_Data it would be more efficient to use an array of byte.
For example,
Dim str1(80) as Byte
will allocate 80 bytes for incoming characters.
Keep an index of the next available empty location, for example,
rxi = 1
Store incoming characters into str1( )
char = RCREG
str1(rxi) = char
rxi = rxi + 1
and stop storing if you have reached the end of str1( ).
All of this is done in the interrupt service routine.
(I am simply repeating code examples already posted by Eric.)
My advice: Don't copy other people's code wholesale unless you fully understand each line of code. By learning how code works you will eventually come out of the woods and be able to see the light on your own.
You want to avoid using too many strings because all strings are allocated the same STRING_MAX_LENGTH storage
For handling incoming UART RX_Data it would be more efficient to use an array of byte.
For example,
Dim str1(80) as Byte
will allocate 80 bytes for incoming characters.
Keep an index of the next available empty location, for example,
rxi = 1
Store incoming characters into str1( )
char = RCREG
str1(rxi) = char
rxi = rxi + 1
and stop storing if you have reached the end of str1( ).
All of this is done in the interrupt service routine.
(I am simply repeating code examples already posted by Eric.)
My advice: Don't copy other people's code wholesale unless you fully understand each line of code. By learning how code works you will eventually come out of the woods and be able to see the light on your own.