  | | | Subject: Need a bit of help | Subject: Need a bit of help 2005-09-05 - By Brian Sands
Back <p>Hello people,</p><p>Having a problem with formatting output in a certain piece of code.? Since I am using a for statement I can't figure out how to put 2 things on a line instead of breaking the line after only one.</p><p>Here is my code:</p><p>?? for( iWear = 0; iWear < MAX_WEAR; iWear++ )<br />??? {<br />????? count = 0;<br />????? if( iWear < ( MAX_WEAR - 3 ) )<br />????? {<br />??????????????? send_to_char( "&B* ", ch);<br />??????????????? sprintf( buf, "%s", where_name[iWear] );<br />??????????????? pager_printf( ch, "&G[&c%-8s&G] ", buf );<br />????? }<br />????? if( ( obj2 = get_eq_char( victim, iWear ) ) == NULL && iWear < ( MAX_WEAR - 3 ) )<br />??????? {<br />???????? sprintf( buf, "Nothing");<br />???????? pager_printf( ch, "&r[&c%-28s&r]", buf );<br />??????? }<br />????? for( obj = victim->first_carrying; obj; obj = obj->next_content )<br />????? {<br />???????? if( obj->wear_loc == iWear )<br />???????? {<br />??????????? count++;<br />??????????? if( count > 1 )<br />??????????? {<br />??????????? sprintf( buf, "%s", format_obj_to_char( obj, ch, TRUE) );<br />??????????? pager_printf( ch, "&r[&c%-28s&r]", buf );<br />??????????? }?? <br />??????????? else<br />??????????? {<br />??????????? sprintf( buf, "%s", format_obj_to_char( obj, ch, TRUE) );<br />??????????? pager_printf( ch, "&r[&C%-28s&r]", buf );?? <br />??????????? }<br />?????????? }<br />??? }<br />?? }</p><p>Here is the output that it gives for that section...</p><p>*????????????????????????????????????????????????????????????? ???????????????????? *<br />* [light?? ] [Nothing???????????????????? ]* [finger? ] [Nothing???????????????????? ]* [finger? ] [<br />Nothing???????????????????? ]* [neck??? ] [Nothing???????????????????? ]* [neck??? ] [Nothing?????? <br />????????????? ]* [body??? ] [a sub issue vest??????????? ]* [head??? ] [a sub issue helmet????????? <br />]* [legs??? ] [Nothing???????????????????? ]* [feet??? ] [a pair of sub issue boots?? ]* [hands?? ] <br />[a pair of sub issue gloves? ]* [arms??? ] [Nothing???????????????????? ]* [shield? ] [a sub issue s<br />hield????????? ]* [body??? ] [Nothing???????????????????? ]* [waist?? ] [Nothing??????????????????? <br />?]* [wrist?? ] [Nothing???????????????????? ]* [wrist?? ] [Nothing???????????????????? ]* [wielded ]<br />?[a sub issue sword?????????? ]* [held??? ] [Nothing???????????????????? ]* [offhand ] [Nothing???? <br />??????????????? ]* [ears??? ] [Nothing???????????????????? ]* [eyes??? ] [Nothing?????????????????? <br />? ]* [wielded ] [Nothing???????????????????? ]* [back??? ] [Nothing???????????????????? ]</p><p>Notice nothing is formatted because I have taken out all line breaks in my attempt to get it to look like this...</p><p>*???????????????????????????????????????????????????????????????? ????????????????? <br />* [light?? ] [Nothing???????????????????? ] ?[finger? ] [Nothing???????????????????? ]</p><p>* [finger? ] [Nothing???????????????????? ] ?[neck??? ] [Nothing???????????????????? ]</p><p>* [neck??? ] [Nothing???????????????????? ] ?[body??? ] [a sub issue vest??????????? ]</p><p>* [head??? ] [a sub issue helmet????????? ]? [legs??? ] [Nothing???????????????????? ]</p><p>* [feet??? ] [a pair of sub issue boots?? ] [hands?? ] [a pair of sub issue gloves? ]</p><p>Notice that there are 2 entries per line instead of just one, or breaking off at the autowrap.</p><p>Please let me know if I can do anything to format for this.</p><p>Sorry about the format of the email if it's bad, I'm writing in a web-based email client.</p><p>-Brian</p>
|
|
 |