![](templates/Classic/images/spacer.gif) |
shalimar GURU
![](images/avatars/114658559147aeed8fee539.gif)
Joined: 04 Aug 2002 Posts: 4717 Location: Pensacola, FL, USA
|
Posted: Wed Oct 24, 2012 6:30 am
[BUG 3.34] #STW doesn't like $local %i |
Code: |
<alias name="tester" id="1150">
<value>#DELCLASS tempstatus
#LOOP 6 {#STW {%format("&20s &f", $test, %i)} {tempstatus}}</value>
<arglist>$test</arglist>
</alias>
|
gives me this in the status window
Code: |
0.00
0.00
0.00
0.00
0.00
0.00 |
Is there a way to get the expected results without permanent variables?
I am trying to make a much more complex formatted string to display percentile results from a dbvar in a table format. |
|
_________________ Discord: Shalimarwildcat |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Oct 24, 2012 6:53 pm |
My guess is that the context for the local variable and %i have changed, rendering them as null in that new context. Perhaps try forming the format result before looping, and perhaps try forgoing the loop entirely by putting everything into a stringlist and simply %expandlist() the variable?
Where is tempstatus, though, and why are you deleting it right before creating it anew? And why are you creating many different status window objects in the first place? |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
shalimar GURU
![](images/avatars/114658559147aeed8fee539.gif)
Joined: 04 Aug 2002 Posts: 4717 Location: Pensacola, FL, USA
|
Posted: Wed Oct 24, 2012 7:44 pm |
tempstatus is the class the #STW objects are being created in
giving how the current implementation regarding multiple #STW does not reflect the help file, it seems the easiest way to clear the status window before recreating the table
used the loop to instead #ADDITEM to a new variable... to expand as you suggested, and that works...
Is there a way to get triggers to fire on the status window (#CW ones, specifically) the module trick doesn't work for this |
|
_________________ Discord: Shalimarwildcat |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Oct 24, 2012 9:11 pm |
I asked WHERE tempstatus was, not WHAT it was. The Status Window is automatically updated the moment you either assign data to a variable referenced in a currently-visible status object, use the #UPDATE command (complex datatypes like stringlists or datarecords aren't automatically updated in the status window), or click on a different window. If your status objects are in a module, then naturally they would never disappear (provided the package was visible to the window, and the module(s) they were contained in were global).
Quote: |
giving how the current implementation regarding multiple #STW does not reflect the help file, it seems the easiest way to clear the status window before recreating the table
|
What part doesn't reflect the helpfile? In the case of multiple status window objects, they are all separated by a newline and displayed in the status window (this is how it worked in ZMud, fyi, so nothing's changed). Perhaps the concept of context can be better explained here, but all that's going to do is add the words "a status window object won't be shown in the status window if it's not visible to the window currently with focus" and all that means is basically:
a)the status window object is defined in a different window (stuff in one window cannot be seen by stuff outside that window)
b)the status window object is defined in a module flagged as external, and that module is in the same package as the window with context (external modules are only visible to stuff in other packages)
c)the status window object is defined in a module flagged as internal, and that module is in a different package than the window with context (internal modules are only visible to stuff in the same package)
d)the status window object is disabled (not visible to anything)
Quote: |
Is there a way to get triggers to fire on the status window
|
The status window is not a window object. As such, it will never appear in the package editor as something you can put other settings into. The status window is globally defined, which means that across all sessions you will only ever actually have one status window, period (not one per #STWIN command, not one per session). If you have multiple status objects, they are all appended into one string internally and separated by a newline. If you want color, your choices are the color functions like %ansi()/raw ansi codes or mxp color tags. |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
shalimar GURU
![](images/avatars/114658559147aeed8fee539.gif)
Joined: 04 Aug 2002 Posts: 4717 Location: Pensacola, FL, USA
|
Posted: Wed Oct 24, 2012 9:34 pm |
Where is it... in the root directory of my session, the default location as it was created by the #STW command
Rereading the helpfile, seems i misunderstood the '+' syntax and thought it would concatenate.
Adding something equivalent to the following would severely clutter up my code.
Code: |
<trigger priority="12220" repeat="true" id="765">
<pattern> (%d.%d)~%</pattern>
<value>#SWITCH (%1=0.0) {#CW black}
(%1>50) {#CW deeppink}
(%1>40) {#CW indigo}
(%1>30) {#CW midnightblue}
(%1>20) {#CW darkslateblue} {#CW darkslategray}
</value>
</trigger>
|
I would need to do it on each of my local vars on creation
$thisTotal=%float($thisTotal)
$scratch=%format("&f&s", (($this.scratch/$thisTotal)*100), "%") |
|
_________________ Discord: Shalimarwildcat |
|
|
![](templates/Classic/images/spacer.gif) |
|
|