Unknown2005-02-17 08:38:11
QUOTE(daganev @ Feb 17 2005, 09:33 PM)
Ok I see the problem then. Your counting 10 chars back from the 80. but once you hit the char your not moving foward to the right side of the next word.
52764
But I thought I made it so it moved forward, with the %word function bit... Hmm.
I fixed the missing character bug, by adding a simple -1:
CODE
#CLASS {Functions|Wrapping}
#ALIAS wrap_function {
 #VARIABLE Wrap_ToDo %1
 #VARIABLE Wrap_Done %null
 #IF (%isnumber( %2)) {#VARIABLE Wrap_At %2} {#VARIABLE Wrap_At 80}
 wrap_next
 #ECHO @Wrap_Done
 }
#ALIAS wrap_next {
 #VARIABLE Wrap_Current {%left( @Wrap_ToDo, %eval( @Wrap_At - 10))%if( !%ends( %left( @Wrap_ToDo, %eval( @Wrap_At - 10)), " "), " ")%word( %right( {%1}, %eval( @Wrap_At - 10)), 1)}
 #VARIABLE Wrap_ToDo {%right( @Wrap_ToDo, %eval( %len( @Wrap_Current) - 1))} // ** << PART I CHANGED << **
 #VARIABLE Wrap_Done {@Wrap_Done%if( @Wrap_Done != %null, %crlf)%trim( @Wrap_Current)}
 #IF (@Wrap_ToDo != %null) {wrap_next}
 }
#VARIABLE wrap {%exec( "wrap_function "%1" "%2"")}
#VARIABLE Wrap_Current {}
#VARIABLE Wrap_ToDo {}
#VARIABLE Wrap_Done {}
#CLASS 0
#ALIAS wrap_function {
 #VARIABLE Wrap_ToDo %1
 #VARIABLE Wrap_Done %null
 #IF (%isnumber( %2)) {#VARIABLE Wrap_At %2} {#VARIABLE Wrap_At 80}
 wrap_next
 #ECHO @Wrap_Done
 }
#ALIAS wrap_next {
 #VARIABLE Wrap_Current {%left( @Wrap_ToDo, %eval( @Wrap_At - 10))%if( !%ends( %left( @Wrap_ToDo, %eval( @Wrap_At - 10)), " "), " ")%word( %right( {%1}, %eval( @Wrap_At - 10)), 1)}
 #VARIABLE Wrap_ToDo {%right( @Wrap_ToDo, %eval( %len( @Wrap_Current) - 1))} // ** << PART I CHANGED << **
 #VARIABLE Wrap_Done {@Wrap_Done%if( @Wrap_Done != %null, %crlf)%trim( @Wrap_Current)}
 #IF (@Wrap_ToDo != %null) {wrap_next}
 }
#VARIABLE wrap {%exec( "wrap_function "%1" "%2"")}
#VARIABLE Wrap_Current {}
#VARIABLE Wrap_ToDo {}
#VARIABLE Wrap_Done {}
#CLASS 0
Daganev2005-02-17 08:59:21
You evaluate the 80 - 10 after the %word bit don't you? I would think you need another subfucntion. Could be wrong. What does it look like now that you didn't erase the last char?
Unknown2005-02-17 09:07:42
Okay, this is what I've got it to now:
#CLASS {Functions|Wrapping}
#ALIAS wrap_function {
 #VARIABLE Wrap_ToDo %1
 #VARIABLE Wrap_Done %null
 #IF (%isnumber( %2)) {#VARIABLE Wrap_At %2} {#VARIABLE Wrap_At 80}
 wrap_next
 #ECHO @Wrap_Done
 }
#ALIAS wrap_next {
 #VARIABLE Wrap_Current {%trim( %left( @Wrap_ToDo, %eval( @Wrap_At - 10))) %trim( %word( %right( @Wrap_ToDo, %eval( @Wrap_At - 10)), 1))}
 #VARIABLE Wrap_ToDo {%right( @Wrap_ToDo, %eval( %len( @Wrap_Current)))}
 #VARIABLE Wrap_Done {@Wrap_Done%if( @Wrap_Done != %null, %crlf)%trim( @Wrap_Current)}
 #IF (@Wrap_ToDo != %null) {wrap_next}
 }
#VARIABLE wrap {%exec( wrap_function "%1" "%2")}
#VARIABLE Wrap_Current {}
#VARIABLE Wrap_ToDo {}
#VARIABLE Wrap_Done {}
#VARIABLE Wrap_At {80}
#CLASS 0
It still has a spacing bug near the ends of lines, though:
(See the "to".)
I just found out that it works in Status Windows too...
CODE
#CLASS {Functions|Wrapping}
#ALIAS wrap_function {
 #VARIABLE Wrap_ToDo %1
 #VARIABLE Wrap_Done %null
 #IF (%isnumber( %2)) {#VARIABLE Wrap_At %2} {#VARIABLE Wrap_At 80}
 wrap_next
 #ECHO @Wrap_Done
 }
#ALIAS wrap_next {
 #VARIABLE Wrap_Current {%trim( %left( @Wrap_ToDo, %eval( @Wrap_At - 10))) %trim( %word( %right( @Wrap_ToDo, %eval( @Wrap_At - 10)), 1))}
 #VARIABLE Wrap_ToDo {%right( @Wrap_ToDo, %eval( %len( @Wrap_Current)))}
 #VARIABLE Wrap_Done {@Wrap_Done%if( @Wrap_Done != %null, %crlf)%trim( @Wrap_Current)}
 #IF (@Wrap_ToDo != %null) {wrap_next}
 }
#VARIABLE wrap {%exec( wrap_function "%1" "%2")}
#VARIABLE Wrap_Current {}
#VARIABLE Wrap_ToDo {}
#VARIABLE Wrap_Done {}
#VARIABLE Wrap_At {80}
#CLASS 0
It still has a spacing bug near the ends of lines, though:
QUOTE
You've just come up with an idea for a new guild, a new skill or how t o
completely re-design Lusternia to make it a hundred times greater and don't
know who to tell? Well, post it here! Be prepared for feedback!
completely re-design Lusternia to make it a hundred times greater and don't
know who to tell? Well, post it here! Be prepared for feedback!
(See the "to".)
I just found out that it works in Status Windows too...
Daganev2005-02-17 09:09:56
Use more text, I don't see that bug on the other lines tofigure out what is causing it.
What do you mean "works in status windows to?"
What do you mean "works in status windows to?"
Unknown2005-02-17 09:14:10
If you put
@wrap( "string")
and remove "#ECHO @Wrap_Done"
and add "@Wrap_Done" at the end of the @wrap function, in a Status Window, it will wrap it without flickering.
Here:
@wrap( "string")
and remove "#ECHO @Wrap_Done"
and add "@Wrap_Done" at the end of the @wrap function, in a Status Window, it will wrap it without flickering.
Here:
QUOTE
You've just come up with an idea for a new guild, a new skill or how t o
completely re-design Lusternia to make it a hundred times greater and don't
know who to tell? Well, post it here! Be prepared for feedback! You'v e
just come up with an idea for a new guild, a new skill or how to comp letely
re-design Lusternia to make it a hundred times greater and don't know who
o to tell? Well, post it here! Be prepared for feedback! You've just c ome
up with an idea for a new guild, a new skill or how to completely re-d esign
Lusternia to make it a hundred times greater and don't know who to tel l?
Well, post it here! Be prepared for feedback!
completely re-design Lusternia to make it a hundred times greater and don't
know who to tell? Well, post it here! Be prepared for feedback! You'v e
just come up with an idea for a new guild, a new skill or how to comp letely
re-design Lusternia to make it a hundred times greater and don't know who
o to tell? Well, post it here! Be prepared for feedback! You've just c ome
up with an idea for a new guild, a new skill or how to completely re-d esign
Lusternia to make it a hundred times greater and don't know who to tel l?
Well, post it here! Be prepared for feedback!
Unknown2005-02-17 09:17:16
It's due to the space in:
#VARIABLE Wrap_Current {%trim( %left( @Wrap_ToDo, %eval( @Wrap_At - 10))) %trim( %word( %right( @Wrap_ToDo, %eval( @Wrap_At - 10)), 1))}
(before the second %trim.)
I need to find a way to see if the word ends there or not, and then put a conditional space there based on this.
#VARIABLE Wrap_Current {%trim( %left( @Wrap_ToDo, %eval( @Wrap_At - 10))) %trim( %word( %right( @Wrap_ToDo, %eval( @Wrap_At - 10)), 1))}
(before the second %trim.)
I need to find a way to see if the word ends there or not, and then put a conditional space there based on this.
Daganev2005-02-17 09:21:58
There is no wordend function? The best way to know that a word ends is by the fact that NEXTCHAR == " ".
Unknown2005-02-17 09:24:19
But how can I add that to it?
Daganev2005-02-17 09:25:59
STick code into your wrap_at variable. So instead of 80 its 80 minus 10 plus the next word. That way you can also take out all the 80 - 10's in your other code and make it cleaner
Unknown2005-02-18 03:55:57
Could you give an example? I'm not sure how you mean to make it go to the next word within the Wrap_At variable.
Daganev2005-02-18 03:59:13
instead of making Wrap_at = 80
Makes wrap_at = %right(%word 80 -10)) or whatever the proper code is.
Makes wrap_at = %right(%word 80 -10)) or whatever the proper code is.
Unknown2005-02-18 04:08:56
I think I'd have to make another variable -- keep Wrap_At as a static number, while make a new one as:
%right( %word( something, 1), %eval( @Wrap_At - 10))
I haven't figured out what "something" should be yet.
%right( %word( something, 1), %eval( @Wrap_At - 10))
I haven't figured out what "something" should be yet.
Unknown2005-02-21 03:44:19
Okay, I got it working now. 
