displaying multiline text from file
What is a good method to read multiline/formatted text from a text
file and display the complete text(incl. linefeeds) in Max?
The task at hand:
User clicks a thumbnail, bigger pic appears, text with info about
this pic is read from file and displayed.
The text object just displays one line, and LCD doesn’t understand CR/
LF, so you get one very long line.
Try filein and translate the ascii code into characters with itoa or
spell, and create a new line whenever you encounter ascii 13.
useful, but I’d start with filein.
Create a newline in what object?
> User clicks a thumbnail, bigger pic appears, text with info about
> this pic is read from file and displayed.
> The text object just displays one line, and LCD doesn’t understand
> CR/LF, so you get one very long line.
i don’t know if you are a jitter user, but if you are, you could also
check out jit.textfile – especially if you wouldn’t mind to display
the text with the use of jit.gl.text2d or so (but if you’re dealing
with pictures anyway…)
[ps …so probably this reply is in the wrong forum now.?.]
On Jan 29, 2006, at 12:54 PM, Jan Klug wrote:
> [ps …so probably this reply is in the wrong forum now.?.]
Who cares — The line is grey and arbitrary. I’m now subscribed to
eight lists instead of one. Just post where you please. I think most
people are on all of them anyway, which of course really defeats the
purpose… I would’ve drawn the line at All Things Max versus All
Unfortunately I’m not a Jitter user yet. Budget for this job is 0, so
buying Jitter is not really an option.
Read your text from your file using filein into a zl group which has
a sufficiently large argument so that no output is triggered
accidentally (e.g. 256).
Once you encounter character 13 in your stream of bytes, bang zl
group, prepend "write" and send its output to LCD. First move its pen
to the beginning of the line and down by an offset defined by your
Please let me know whether this has been of any help.
Forums > MaxMSP