[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Ahh more exact number ranges...

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Ahh more exact number ranges...

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 

Posted by Gtr   (38 posts)  [Biography] bio
Date Reply #15 on Tue 13 Jul 2004 05:14 AM (UTC)  quote  ]
Message
Indeed, I just wasnt too comfortable with switch statements yet, but I understand them now that I'v seen them work with somthing I did with somthing else heh, and yeah it looks a hell of alot nicer, thanks nick.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Tue 13 Jul 2004 05:32 AM (UTC)  quote  ]
Message
Yeah, good.

Of course, you have a mathematical relationship there so you could write it this way:


if (holding->value[0] >= && holding->value[0] <= 5)
  test1 = number_range( holding->value[0] * 10, 50 );
else
  test1 = 0;



(That is, just multiply by 10, that is all you are doing in your switch/if anyway).


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Gtr   (38 posts)  [Biography] bio
Date Reply #17 on Tue 13 Jul 2004 08:01 AM (UTC)  quote  ]
Message
Hrmm I would have never thought of that, thou I'm well versed in coming up with formulas now. I must admit the switch statement on the other hand, I'm making lots of use of cleaning up all my existing code.

Thanks again Nick.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,481 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]