Raised This Month: $ Target: $400
 0% 

Three parameter matrix - nvault saving


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-08-2014 , 14:38   Re: Three parameter matrix - nvault saving
Reply With Quote #1

You're saving everything with the same key. I doubt that will work at all.

Code:
    for(new i, a; i < UpgradeInfo; i++)     {         for(a ; a < Teams; a++)
Using this will also not work. "a" is created outside of the scope of the second for-loop. Because you're never setting it to 0 again the second for-loop will not run more than once.
Here's an example to show you more clearly:
Code:
    for ( new i, j ; i < 3 ; i++ ) {         server_print("i: %d", i);         for ( ; j < 3 ; j++ ) {             server_print("j: %d", j);         }     }
Code:
i: 0
  j: 0
  j: 1
  j: 2
i: 1
i: 2
As you can see, the j loop runs only once, because it's never reset meaning the statement "j < 3" will return false.



And why you are getting that expression has no effect:
Code:
for ( a ; a < Teams ; a++ ) {     // Your code }
You can translate this to something like this:
Code:
a while ( a < Teams ) {     // Your code     a++; }
And of course, that a looks lonely there. Assuming you would not need to reset the variable a, you could've used something like this:
Code:
for ( ; a < Teams ; a++ ) {     // Your code }
But that is not the case, so it's irrelevant.

I'm assuming you stripped a lot of code before you posted.
__________________

Last edited by Black Rose; 07-08-2014 at 14:45.
Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode