Robinsonx6
asked on
Setting a range value in a struct
hi i have the following struct
public struct Camera
{
public Coordinate Coordinate;
public int Pitch;
public int Altitude;
public int Direction;
public int Distance;
}
what i want to is when the value is set for Direction i want to only allow 1 to 360 positive range to be allowed, how would i do this within my sruct so that i do not have to include any validation code on all the pages which use the struct.
I hope this makes sence
chears
public struct Camera
{
public Coordinate Coordinate;
public int Pitch;
public int Altitude;
public int Direction;
public int Distance;
}
what i want to is when the value is set for Direction i want to only allow 1 to 360 positive range to be allowed, how would i do this within my sruct so that i do not have to include any validation code on all the pages which use the struct.
I hope this makes sence
chears
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not quite sure what you mean. You can just use this code for the struct and use it like you used the struct before. Is that what you want to know?
Hope the lorry driver is ok ;)
Razzie
Hope the lorry driver is ok ;)
Razzie
ASKER
lorry driver is ok but as he was pissed and put me 6 days behind deadline i would like to kill him, lol, it took so long to repasir as this is mauritius!!!!
yeah that is what i meant ill try it shortly.
thanks
yeah that is what i meant ill try it shortly.
thanks
ASKER
will i need to put any code on the pages which use the struct?