Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 02-01-2004, 03:05 PM   #1 (permalink)
I R TEH POSTING!!1!eleven
 
Join Date: Jan 2004
Posts: 1,617
Default Questionable statement?

On line 141 of Client.cs, I see the following:

[code:1] for ( int i = 0;; ++i )[/code:1]

I'm wondering if that should be i++ since as written it will skip the first chunk after 0x400000 in line 143 inside the loop:

[code:1] pc.Seek( 0x400000 + (i * chunkSize), SeekOrigin.Begin );[/code:1]

Do I have a point or am I completely wrong?

Thanks,
Ignacio
Ignacio Vazquez-Abrams is offline   Reply With Quote
Old 02-01-2004, 03:35 PM   #2 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 21
Posts: 3,933
Default

You are wrong.
TheOutkastDev is offline   Reply With Quote
Old 02-01-2004, 03:38 PM   #3 (permalink)
I R TEH POSTING!!1!eleven
 
Join Date: Jan 2004
Posts: 1,617
Default

I don't suppose that there's a reason why you say that, is there?

Cheers,
Ignacio
Ignacio Vazquez-Abrams is offline   Reply With Quote
Old 02-01-2004, 06:11 PM   #4 (permalink)
Forum Administrator
 
krrios's Avatar
 
Join Date: Aug 2002
Posts: 2,850
Default

The third statement in a for line is executed after any statements inside the for block. In this case, it's like:

[code:1]int i = 0;

while ( true )
{
..code here..
++i;
}[/code:1]
krrios is offline   Reply With Quote
Old 02-01-2004, 06:11 PM   #5 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 21
Posts: 3,933
Default

Loop starts at zero.
TheOutkastDev is offline   Reply With Quote
Old 02-01-2004, 07:22 PM   #6 (permalink)
I R TEH POSTING!!1!eleven
 
Join Date: Jan 2004
Posts: 1,617
Default

Hmm. I thought a preincrement in the iteration would increment it before the loop started, but a took a closer look and it doesn't. Never mind then.

Thanks,
Ignacio
Ignacio Vazquez-Abrams is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5