K
Kaypee
Howdy all
am trying to convert c# app to VB so change alter parts of it.
But am getting confused by a couple of bits... at least ;-)
a)
private point[] path1(point p1, point p2) {
int minX = Math.Min(p1.X, p2.X);
int maxX = Math.Max(p1.X, p2.X);
for (i = minX + 1; i < maxX && isCellEmpty(p1.Y, i); i++) ;
return i == maxX ? new Point[] { p1, p2 } : null;
}
isCell Empty returns boolean
can convert most but for line confusing me. is loop all that line or is
return part of loop
if only looping that line - it does nothing. If return part of the loop -
can you return more than once...
b)
public event EventHandler OnGameWon {
add {
gameWon += value;
}
remove {
gameWon -= value;
}
}
What the heck? add? remove? new c# 2005 I think - msdn help just confuses
me.
Any assistance greatly appreciated
am trying to convert c# app to VB so change alter parts of it.
But am getting confused by a couple of bits... at least ;-)
a)
private point[] path1(point p1, point p2) {
int minX = Math.Min(p1.X, p2.X);
int maxX = Math.Max(p1.X, p2.X);
for (i = minX + 1; i < maxX && isCellEmpty(p1.Y, i); i++) ;
return i == maxX ? new Point[] { p1, p2 } : null;
}
isCell Empty returns boolean
can convert most but for line confusing me. is loop all that line or is
return part of loop
if only looping that line - it does nothing. If return part of the loop -
can you return more than once...
b)
public event EventHandler OnGameWon {
add {
gameWon += value;
}
remove {
gameWon -= value;
}
}
What the heck? add? remove? new c# 2005 I think - msdn help just confuses
me.
Any assistance greatly appreciated