Slysven
Joined: 10 Apr 2011 Posts: 260 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Tue Oct 11, 2011 7:45 pm Post subject: #FORMAT addition: print character (string) multiple times? |
|
|
I was cobbling together a bargraph display last night and realised I had to use a loop to add each character to a variable to build it up. Is there any merit to the idea of a #FORMAT code that could say take an integer numeric argument and repeat the item that followed it that many times. The most programmatically logical arrangement I could see would either multiple the %item or the literal character following the code (I suggest %X for "multiplication") - this would enable the following sort of action, [with requirement that 0 does not print item at all]:
| Code: | #FORMAT {test} {%X%s} {3} {Testing...}
#SHOWME $test
Testing...Testing...Testing...
#VARIABLE status[heath_units] 3
#VARIABLE status[heath_units_max] 8
#FORMAT {test} {Heath: %X#%X_} {$status[heath_units]} {$status[heath_units_max]-$status[heath_units]}
#SHOWME $test
Heath: ###_____ |
Do others think this would be bloat, or of some use? |
|