Link to home
Start Free TrialLog in
Avatar of Robinsonx6
Robinsonx6Flag for Mauritius

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
ASKER CERTIFIED SOLUTION
Avatar of Razzie_
Razzie_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robinsonx6

ASKER

sorry for delay as lost all internet due to crazy lorry driver crashing into telecoms pole outside office.

will i need to put any code on the pages which use the struct?
Avatar of Razzie_
Razzie_

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
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