reading through the docs and forums i found that the max string length
is 2048 and needs to be enclosed inside [text] [/text] tags.
I'm thinking that i misunderstood something, because reading about
processing web pages I'm sure there are times that strings are longer
than 2048.
So what did i miss or misunderstand ?p.
Hi,
the [text] [/text] quote you only need when you are creating texts
(>2048 chars) that should be i.e. printed to IO..
newlisp itself automaticly handles string size. If you processing a webpage
you dont have to bother about the size.
if you use i.e. get-url and would output it to the screen you
will see that newlisp automaticly marks it as [text]..[/text]..as
a referance that its 2048 long(er)...
Regards, Norman.
Quote from: "mostlywrong"
reading through the docs and forums i found that the max string length
is 2048 and needs to be enclosed inside [text] [/text] tags.
I'm thinking that i misunderstood something, because reading about
processing web pages I'm sure there are times that strings are longer
than 2048.
So what did i miss or misunderstand ?p.
As with any new language, it takes a little time to figure out how to effectively search the docs.
From the manual:
Quote
Strings may contain null characters and can have different delimiters. They evaluate to themselves.
"hello" →"hello"
" 32 32 65 32" →" A "
"x20x20x41x20" →" A "
"trn" →"trn"
"x09x0dx0a" →"trn"
;; null characters are legal in strings:
" 00 01 02" → " 00 01 02"
{this "is" a string} → "this "is" a string"
;; use [text] tags for text longer than 2048 bytes]
[text]this is a string, too[/text]
→ "this is a string, too"
You'll also get used to the parentheses. I often use a lot of extra lines to keep track of them:
(setq result (div
(mul 100
(add
(div range 2)
val
)
)
range
)
)
same as
(setq result (div (mul 100 (add (div range 2) val)) range))
I find it much easier to scan through the code and see the arguments that are used with div, mul, add, div when it is not strung together in a single line.
ok, i just misread the docs. what it said was text constants (more or less) in the code need to be tagged for the processor if larger than 2048 chars. got it.