Sign in to follow this  
Followers 0
layer

AutoUpdateIt

5 posts in this topic

this is more a nit pick than anything, but i just wanted to point out that AutoUpdateIt says under latest BETA (its 12/12/05 right now) "December 12nd" .. i dont know what other numbers it does this sort of thing for, because i've only noticed it now.


FootbaG

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The numbers 11 to 13 are special cases so it would probably say 11st and 13rd as well, given the chance. I imagine that it wouldn't be hard to fix.

Edit: Why not just simplify the logic and remove ordinals altogether? December 12 is just as good.

Edited by LxP

Share this post


Link to post
Share on other sites

While we are on nit picks. I would like to state one. I go to run the program. It doesnt tell me which version of the beta I have installed. I think that would be a nice addition.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Why not just simplify the logic and remove ordinals altogether? December 12 is just as good.

Agreed.

But here's a simple fix for numbers on the range 1 to 31.

Func _NumSuffix($i_Num)
    $i_Num = "," & $i_Num & ","
    If StringInStr(",1,21,31,", $i_Num) Then Return "st"
    If StringInStr(",2,22,", $i_Num) Then Return "nd"
    If StringInStr(",3,23,", $i_Num) Then Return "rd"
    Return "th"
    Return $i_Num
EndFunc

Or a general recursive function that should work for non-negative integers.

Func _NumSuffix($i_Num)
    $i_Num = StringRight($i_Num, 2);make sure numbers over 100 work right
; Base Cases
    If $i_Num = 0 Then Return "th"
    If $i_Num = 1 Then Return "st"
    If $i_Num = 2 Then Return "nd"
    If $i_Num = 3 Then Return "rd"
    If 4 <= $i_Num And $i_Num <= 20 Then Return "th"
; Recursive case
    Return _NumSuffix(Mod($i_Num,10))
EndFunc
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Somebody should go ahead and write (and submit) these improvements, cus I'm sure not updating the darn thing anymore. :P

The whole system that's been setup with the beta is too complex for me. Running the stable, next to the beta, in different folders, etc., I don't bother. When a new beta comes out, I download, overwrite my existing install, and away I go. I can't remember the last time I ran the stable release.

Edited by Saunders

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0