Graphics.StringDirection

From Xojo Documentation

Method

Graphics.StringDirection(text As String) As Integer

New in 2005r1

Supported for all project types and targets.

Returns an Integer that indicates the direction in which the text is written.

Notes

This is useful for non-Roman systems, especially Middle-Eastern languages. If you pass an empty string, it returns the system default string direction. If this function is not supported on the user's system, it will return -1; otherwise it will return either 0 for left to right or 1 or right to left.

There are three class constants that you can use to test the string direction:

Class Constant Value
TextDirectionUnknown -1
TextDirectionLeftToRight 0
TextDirectionRightToLeft 1

Sample Code

This example gets the string direction.

Dim i As Integer
i = g.StringDirection("Hello world")