Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ 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 page
Pages: 1
2
| Posted by
| Gtr
(38 posts) 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. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) 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 | | Top |
|
| Posted by
| Gtr
(38 posts) 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. | | 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.
61,434 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top