mob
verb
showcode(m as message)
world << browse(m,"window=[m]")
What happens is, you type the message, and it come up in one line! Like if I typed:
mob
verb
showcode
it would come up as:
mob verb showcode
Does anyone know the problem?
ID:267514
![]() Jun 2 2003, 10:47 am
|
|
Well, I am trying to get a showcode like verb in my game, so I'll just call it that for now.
mob What happens is, you type the message, and it come up in one line! Like if I typed: mob verb showcode it would come up as: mob verb showcode Does anyone know the problem? |
![]() Jun 2 2003, 11:19 am (Edited on Jun 2 2003, 1:14 pm)
|
|
Yes. Your problem is that the new lines when typing something into the message box are represented by "\n". HTML does not recognize this, and uses <BR> instead. You'll have to replace all instances of "\n" with <BR>
|
No, tabs do not do anything either. I'm sorry Garthor, but I didn't follow much of what you said...I guess I'll just skip this command for a bit...
|
Garthor wrote:<code> > var/pos > pos = findtext(m,"\n") > while(pos) > m = copytext(m,1,pos)+"<BR>"+copytext(m,pos+</code>2<code>) > pos = findtext(m,"\n")</code>
That should be 1 instead of 2. |
There's a far simpler solution to this; surround the text in <pre> tags. =P
<code> mob verb showcode(m as message) world << browse("<pre>[m]</pre>","window=[m]")</ code> |