;; [text], [/text] tags for text longer 2048 bytes

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

;; [text], [/text] tags for text longer 2048 bytes

Post by newdep »

Hello Lutz,

[text] seems to be enabled for 'read-file and -read-buffer also.

That way im missing the option of reading bigger files in raw data (text)
into a buffer to verify the data for i.e. "\r\n\t"...

Files bigger then 2048 now always popup "formatted" in newlisp with [text]

Is it an option to disable/enable automatic use of [text] in 'read-file 'read-buffer...Or is there another option to bypass this using pack? perhpas?

Or is it just a visual effect?

Norman.
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

[text], [/text] delimiters leave the text unprocessed, this way you can use it when writing newLISP server with embedded HTML, which is then processed by the function CGI:put-page, and use the tags for other purposes wher you want unprocessed text. You could write a litle (display filename) function, which displayes the text in smaller portions, so you see the encoded characters:

(define (display filename)
(print (replace "\n" (read-file filename) "\\n" 0)))

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

ok thanks i see now the use of [text] in read-file/line.
-- (define? (Cornflakes))

Locked