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


Register forum user name Search FAQ

Gammon Forum

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

Ahh more exact number ranges...

It is now over 60 days since the last post. This thread is closed.     [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)
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  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Tue 13 Jul 2004 05:32 AM (UTC)
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)
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.


45,887 views.

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

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]