Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSLogMBS(message as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Cocoa MBS Main Plugin 12.3 Yes No No Yes, macOS only No
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:

Feedback, Comments & Corrections

NSStringArraySortMBS(texts() as string, options as Integer) as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Cocoa MBS Main Plugin 16.1 Yes No No Yes, macOS only No
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.

Feedback, Comments & Corrections

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




Links
MBS Xojo PDF Plugins