TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arthur
NA
22
44.9k
C# class or no class... question from newbie
Nov 2 2010 2:03 PM
Hi all,
I'm new to C# and have a question please. Here's the problem. I'm trying to modify some C# program where I call some methods within if... else if... directives repeatedly:
if (some val >= 40 && other val < 0)
{
DrawArrowDown("MyDnArrow" , true, 1, (hh+0.0002), Color.OrangeRed);
DrawDiamond("MyDiamond", true, 1, (hh+0.0011), Color.Blue);
DrawTriangleDown("MyDownTriangle", true, 1, (hh+0.0013), Color.Blue);
}
else if (some val < 40... && ... >=30 ...)
{
DrawArrowDown("MyDnArrow" , true, 1, (hh+0.0002), Color.OrangeRed);
DrawDiamond("MyDiamond", true, 1, (hh+0.0011), Color.Blue);
DrawTriangleDown("MyDownTriangle", true, 1, (hh+0.0013), Color.Blue);
}
else if (some val < 30... && ... >=20 ...)
{
DrawArrowDown("MyDnArrow" , true, 1, (hh+0.0002), Color.OrangeRed);
DrawDiamond("MyDiamond", true, 1, (hh+0.0011), Color.Blue);
DrawTriangleDown("MyDownTriangle", true, 1, (hh+0.0013), Color.Blue);
}
else if...
I came from Oracle PL/SQL world where there used to be no classes but procedures, functions and packages... In Oracle I'd simply create some procedure with parameters to call those repetitive Draw...() statements, smth like this: Procedure PlotSignals(arrowhandle, true, arrow_pos, color)... and call this proc. in if... else if... passing the correct parameters. How can I simplify this and create some procedure in C# please? Any examples would be much appreciated.
Thank you very much.
Reply
Answers (
13
)
how to read each character from a string using c sharp
working on project with four classes (need serious help)