Difference between revisions of "Gkmisc"

From Vendetta Lua
Jump to: navigation, search
(date)
(strnatcasecmp)
Line 41: Line 41:
 
=== strnatcasecmp ===
 
=== strnatcasecmp ===
 
'''Definition:'''
 
'''Definition:'''
<br><br>
+
<br>Natural Sort Order<br>
 
'''Description:'''<br>
 
'''Description:'''<br>
<br><br>
+
<br>Human readable natural sort order for strings. Similar to strnatcmp(), except that the comparison is not case sensitive. For more information see: Martin Pool's » Natural Order String Comparison page. [http://sourcefrog.net/projects/natsort/]<br>
 
'''Arguments:'''
 
'''Arguments:'''
<br><br>
+
<br>(a,b)<br>
 
'''Returns:'''
 
'''Returns:'''
<br><br>
+
<br>+1 = left side (a) smaller, 0 = equal, -1 = right side (b) smaller.<br>
 
'''Example:'''
 
'''Example:'''
<br><br>
+
<br>table.sort(my_table, function(a,b) return gkmisc.strnatcasecmp(a,b) < SORT_DIRECTION end<br>
 
+
 
+
 
+
  
 
=== strnatcmp ===
 
=== strnatcmp ===

Revision as of 22:23, 24 May 2008

date

Definition:

Description:
print formatted date [1]
same as Os#date but the year is shifted ~2000 years forward (ingame date)

Arguments:

Returns:

Example:

DiffTime

Definition:

Description:


Arguments:

Returns:

Example:


chatfilter

Definition:

Description:


Arguments:

Returns:

Example:


strnatcasecmp

Definition:
Natural Sort Order
Description:

Human readable natural sort order for strings. Similar to strnatcmp(), except that the comparison is not case sensitive. For more information see: Martin Pool's » Natural Order String Comparison page. [2]
Arguments:
(a,b)
Returns:
+1 = left side (a) smaller, 0 = equal, -1 = right side (b) smaller.
Example:
table.sort(my_table, function(a,b) return gkmisc.strnatcasecmp(a,b) < SORT_DIRECTION end

strnatcmp

Definition:

Description:


Arguments:

Returns:

Example:


GetGameTime

Definition:

Description:


Arguments:

Returns:

Example:


GKGetHostName

Definition:

Description:


Arguments:

Returns:

Example: