Hello Beto,

B>>
dirarray = 0 'reset pointer char to 0 (the array)
lineloper:
i2cread porta.2,porta.1,$a0,direccion,[j] 'read char
if (j=0 ) then doneline '0 = end of line
dirarray = direccion
string[dirarray] = j 'make string
direccion = direccion +1 'inc addr
pause 100
goto lineloper 'next char
doneline:
direccion = direccion +1 'skip the enf of line (0)
return 'we done
<<
ok...

At first, you set Dirarray to zero.. then the very next 3 lines, you assign it to the value of Direccion.

Thus, when you are loading up your new string called String[dirarray], you are not starting from the beginning... YOu are starting from the "end"

I have no way to check this, but try..

Change it to something like this:

dirarray = 0 'reset pointer char to 0 (the array)
lineloper:
i2cread porta.2,porta.1,$a0,direccion,[j] 'read char
if (j=0 ) then doneline '0 = end of line
string[dirarray] = j 'make string
dirarray=diarray+1;
direccion = direccion +1 'inc addr
pause 100
goto lineloper 'next char
doneline:
direccion = direccion +1 'skip the enf of line (0)
return 'we done


Dwayne