Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Mon Sep 29, 2008 12:45 am   

Odd behavior observed when using <dest> to update a window.
 
I have a script that processes database records. This script updates an information window with a number indicating how many records have been processed thus far. I use:
Code:

#MXP <DEST windowname>X = x-coord Y = y-coord>$value</DEST>

This correctly updates the information window. However, starting with 256 and in a sequence 257 apart, the main window gets sent a counter value. This value does not reach the destination target of <DEST>. That is, it will update the information window up to the number 255, then output the number 256 to the main window, thereafter continuing with 257 in the information window. This cycle is repeated every time the counter is output with a value 257 larger than the last deviant instance.
_________________
Sic itur ad astra.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Sep 29, 2008 4:36 pm   
 
I couldn't reproduce this. There is no way for DEST to know what your $value is to send it to the window or not. So I need to see a test script that shows this problem happening. I tried this in a loop and couldn't get it to fail.

I'm assuming the extra > character in your example (after the windowname) is just a typo?
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Tue Sep 30, 2008 3:19 am   
 
Yes, it is a typo. Below is the relevant parts of the script I am using:
Code:

....
....
#MXP <FRAME NAME = "CharD" OPEN TITLE="Character Data" WIDTH="80C" HEIGHT="10C" FLOATING>
#MXP <dest "CharD"><color orange>UpdateSDB: </color><color white>Table </color><color yellow>$table</color><color white> number of spell/skills added: </color><color yellow>0</color></dest>
$length = %len( $table) + 49
$rc     = 0
....
....

I must point out here that FLOATING does nothing. It starts out as TOP and I have to manually set it to floating. Subsequent uses of the window will have it floating. I've always had the same problem with #MAKEWINDOW so it may not be related to the use of #FRAME.The code opens the window and puts the basic text out there for later update.
Code:

....
....
#FORALL $rec {#IF (!%numitems( %db( %i, SubClassList)) OR %ismember( %db( @lcrec, SubClass), %db( %i, SubClassList))) {
....
....
$rc = $rc + 1
#MXP <dest "CharD" X=$length Y=1><color yellow>$rc</color></dest>
}


Now, this was working the first time I tried it. It has behaved oddly since. For one thing, and I am sure I am doing something wrong, the update spot is ignored (it should be replacing the 0) and the updating information is being place at the lower left-hand corner of the script. When the count reaches 256, it will output this value to the main window, thereafter it will do it to 513, 780, 1013, etc.

EDIT: I found out something interesting. I changed the original output to the window like this:
Code:

#MXP <dest "CharD" X=1 Y=1><color orange>UpdateSDB: </color><color white>Table </color><color yellow>$table</color><color white> number of spell/skills added: </color><color yellow>0</color></dest>

By giving it explicit positioning for the line, the updates to the text landed at the right location. However, it still duplicated the data at the bottom left-hand corner of the scrreen and continued the cyclic updates to the main window.
_________________
Sic itur ad astra.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Sep 30, 2008 5:12 pm   
 
I'll put the issue with Floating not working onto the bug list.

For the #MXP command, you might try putting {} around your argument, like:
Code:
#MXP {<dest "CharD" X=$length Y=1><color yellow>$rc</color></dest>}

The #MXP command has a default first argument that is the mode (secure/open) to use, and the space after "
If you increment $rc by 2 instead of 1 does it still happen at the same value? In other words, does it really depend upon the value of $rc, or does it just happen on the 256th output to the DEST command no matter what the value is?
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Wed Oct 01, 2008 1:25 am   
 
I changed the code so it just did a loop from 1 to 5000 and set out the counter incremented by 2.
What happened in this instance is that the series began at 510, then 1020, 2040, 4080, etc. However, when I ran the original code that does not go past 435, so that it only goes through the cycle once, it placed 512 in the main window, not 510 as in the multi-cycle test.

EDIT: When I placed the brackets around the arguments as you suggested, the data was placed correctly each time and the problem with duplicating the value at the lower left-hand corner of the information window went away. Peculiarly enough, even for the single-cycle pass, 510 was sent to the main window (still testing with +2), when previously it was sending 512 for the single-cycle.
_________________
Sic itur ad astra.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net