Page 1 of 1

problem with read.s string{size}

Posted: Wed Jul 21, 2010 8:47 pm
by gabriel
Hello:
I've problem with this small program, using data, restore, read seems not working with fixed size strings, why?

Code: Select all

Define str.s{100}, str1.s

Restore label1
Read.s str
Read.s str1
Debug str
Debug str1
End


DataSection
label1:  Data.s  "Hello", "world"
EndDataSection
Thank you

Re: problem with read.s string{size}

Posted: Wed Jul 21, 2010 9:35 pm
by netmaestro
You can't do that. Data in datasections must be of a basic native type:
PB Doc for Data keyword wrote:Defines data. The type can only be a native basic type (integer, long, word, byte, ascii, unicode, float, double, quad, character, string).
As a fixedstring cannot reside in the datasection, it can't be read from there either. You could read it into a temporary string var and assign it from there to a fixedstring var.

Re: problem with read.s string{size}

Posted: Thu Jul 22, 2010 5:01 am
by gabriel
Thank you