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
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Sat Oct 03, 2009 6:28 pm   

strange incrementing issue
 
i have a couple indexes that i use to pop through my stringlist of paths and mobs and this wierd thing happens.

it seems to be inconsistent

i=1
i=2
i=3
i=1
i=5
i=6

i is supposed to count to 26 before it resets to 1.

it seems like it may be a cmud bug and i was wondering if anyone else has seen behavior like this.

what i don't get is if my code lost track of i and set it to 1 by mistake how did it then get back on track?

any idea's?

i can post my code but i thought i would ask if there was any known issues first. i have tried to catch it with the debugger but it doesn't seem to happen when the debugger is on.

my loop will work a dozen times then it starts flaking out and then it can fix itself and keep going ?

i have tried incrementing i with the #add function and the #math function and the i= @i+1. they all seem to have the same problem.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Oct 03, 2009 10:04 pm   
 
You're likely problem is that you have more than one @i variable, with one apparently being in a class that enables/disables frequently.

In general, it's better to post your code in your initial posting; if the code doesn't appear to be the problem, we can always ask more detailed questions about things you might not know about or hadn't thought of.
_________________
EDIT: I didn't like my old signature
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Sat Oct 03, 2009 11:41 pm   i found an intersting issue
 
for some reason my ipath and imobs variable is getting created in different places in my code structer so some times it gets created multiple times.

one interesting thing is it even gets created in my different charactor windows.

any idea how to fix this issue?

when i call it i am currently using the var = @var +1 syntax
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sun Oct 04, 2009 11:56 pm   
 
When you say your variables are being recreated elsewhere are you disabling the folders the variables are located in? If you are and are trying to assign a value, it will recreate the variable outside of the folder. Take your variable example and put it in an untitled session in a class folder and disable the folder. Then do var = @var + 1 it will create a new var outside of the folder with the value of 1.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Oct 05, 2009 2:56 am   
 
Also note that it is normal for each window to have separate variables, unless both sessions share some secondary package which is loaded in each, in which case they will share the variables in that shared package. But any enabled variables with the same name within the window itself will override any variable in a secondary package.
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