MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSLogMBS(message as string)
global method, Cocoa, MBS Main Plugin (NSBase),
Plugin version: 12.3, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Writes a message to the Console.app on Mac OS X.
Example:
Sub Log(message as string)
if TargetMacOS then
NSLogMBS message
else
System.DebugLog message
end if

End Sub
Notes: As with Mac OS X 10.8 the system.debugLog method does not write to Console.app. So use this function.

Some examples using this method:

NSStringArraySortMBS(texts() as string, options as Integer) as string()
global method, Cocoa, MBS Main Plugin (NSBase),
Plugin version: 16.1, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Sorts array of string with options.
Example:
// constants for the function:
const NSCaseInsensitiveSearch = 1
const NSLiteralSearch = 2
const NSBackwardsSearch = 4
const NSAnchoredSearch = 8
const NSNumericSearch = 64
const NSDiacriticInsensitiveSearch = 128
const NSWidthInsensitiveSearch = 256
const NSForcedOrderingSearch = 512

const NSOrderedAscending = -1
const NSOrderedSame = 0
const NSOrderedDescending = 1

// test array

dim a() as string = array("Test 1", "Test 2", "Test 12")

// sort with Cocoa sorting
dim r() as string = NSStringArraySortMBS(a, NSDiacriticInsensitiveSearch + _
NSWidthInsensitiveSearch + _
NSCaseInsensitiveSearch + _
NSNumericSearch)

// sort with xojo
a.sort

// show result
MsgBox "Cocoa: "+Join(r,", ")+EndOfLine+_
"Xojo: "+Join(a, ", ")
Notes: This function allows you to use NSStringCompareMBS for array sorting.

The items on this page are in the following plugins: MBS Main Plugin.




Links
Kerzendesign in Nickenich