B4J Programming Press on the image to return to the main documentation page.

jMFLib

Written by Manfred Fuchs - \u00a9 2014 - http://www.vulpessoft.de

List of types:

MF_Base
MF_Date
MF_File
MF_Info
MF_Math
MF_String

MF_Base


Events:

None

Members:


  Copyright As String

  Version As String

Members description:

Copyright As String
Returns the MFLib copyright string.

Example:
Sub Process_Globals
Dim MF_Base As MF_Base
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim copyright As String
copyright = MF_Base.Copyright
End Sub
Version As String
Returns the MFLib version.

Example:
Sub Process_Globals
Dim MF_Base As MF_Base
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim version As String
version = MF_Base.Version
End Sub

MF_Date


Events:

None

Members:


  Easter (year As Int) As Long

  EncodeDate (year As Int, month As Int, day As Int) As Long

  EncodeDateTime (year As Int, month As Int, day As Int, hour As Int, minute As Int, second As Int, milliSecond As Int) As Long

  EncodeTime (hour As Int, minute As Int, second As Int, milliSecond As Int) As Long

  FromJulian (j As Double) As Long

  IsLeapYear (year As Int) As Boolean

  ToJulian (dt As Long) As Double

Members description:

Easter (year As Int) As Long
Calculates the date of easter sunday for the given year.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim easter As Long
easter = MF_Date.Easter(2014)
End Sub
EncodeDate (year As Int, month As Int, day As Int) As Long
Encodes year, month and day to standard date format.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Long
result = MF_Date.EncodeDate(2014, 4, 23)
End Sub
EncodeDateTime (year As Int, month As Int, day As Int, hour As Int, minute As Int, second As Int, milliSecond As Int) As Long
Encodes year, month, day, hour, minute, second and millisecond to standard date format.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Long
result = MF_Date.EncodeDateTime(2014, 4, 23, 14, 22, 8, 0)
End Sub
EncodeTime (hour As Int, minute As Int, second As Int, milliSecond As Int) As Long
Encodes hour, minute, second and millisecond to standard date format.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Long
result = MF_Date.EncodeTime(14, 22, 8, 0)
End Sub
FromJulian (j As Double) As Long
Convert the given julian date to standard date format.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Long
result = MF_Date.FromJulian(2456770.5)
End Sub
IsLeapYear (year As Int) As Boolean
Check if the given year is a leap year.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_Date.IsLeapYear(2014)
End Sub
ToJulian (dt As Long) As Double
Convert the given standard date format to julian date.

Example:
Sub Process_Globals
Dim MF_Date As MF_Date
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim julian As Double
julian = MF_Date.ToJulian(DateTime.DateParse("04/23/2014"))
End Sub

MF_File


Events:

None

Members:


  ApplicationPath As String

  ChangeExt (path As String, newExt As String) As String

  CurrentDir As String

  Exists (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean) As Boolean

  FileDir (path As String) As String

  FileExt (path As String) As String

  FileName (path As String) As String

  FileSeparator As String

  Find (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean) As String

  ListFiles (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean) As java.util.List

  ListFiles2 (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean, recursive As Boolean, includeFiles As Boolean, includeDirs As Boolean) As java.util.List

  MakePath (dirName As String, fileName As String) As String

  Move (dirSource As String, fileSource As String, dirTarget As String, fileTarget As String, replaceExisting As Boolean) As Boolean

  PathSeparator As String

  Rename (dirSource As String, fileSource As String, dirTarget As String, fileTarget As String) As Boolean

  TempDir As String

  UserDir As String

Members description:

ApplicationPath As String
Returns the application file path (including application file name).
Does not work on Android.
CAUTION: this function works only in release mode. In debug mode, the path of MFLib.jar library will be returned.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
path = MF_File.ApplicationPath
End Sub
ChangeExt (path As String, newExt As String) As String
Change the file extension from a given path.
A empty string parameter removes the extension.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
Dim fName As String
path = MF_File.MakePath(File.DirInternal, "testfile.txt")
fName = MF_File.ChangeExt(path, ".log")
End Sub
CurrentDir As String
Returns the current directory.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
path = MF_File.CurrentDir
End Sub
Exists (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean) As Boolean
Check if file exists in directory, the filename can use wildcard characters (*, ?).
Set ignoreCase to True to ignore case sensitivity on compare.
If extendedCompare is True the filename can also contains the wildcard + and character ranges ([a,b,c] or [a-z]).
Wildcard + is same as * but at least one character must exist (* accepts empty strings).

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_File.Exists(File.DirInternal, "*.jpg", True, False)
End Sub
FileDir (path As String) As String
Returns the full directory name from a given path.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
Dim fName As String
path = MF_File.MakePath(File.DirInternal, "testfile.txt")
fName = MF_File.FileDir(path)
End Sub
FileExt (path As String) As String
Returns the file extension from a given path.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
Dim fName As String
path = MF_File.MakePath(File.DirInternal, "testfile.txt")
fName = MF_File.FileExt(path)
End Sub
FileName (path As String) As String
Returns the file name from a given path.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
Dim fName As String
path = MF_File.MakePath(File.DirInternal, "testfile.txt")
fName = MF_File.FileName(path)
End Sub
FileSeparator As String
Returns the file separator ("/" on Unix, "\" on Windows).

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim sep As String
sep = MF_File.FileSeparator
End Sub
Find (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean) As String
Returns the real file name if the file exists in directory or an empty string if not.
The filename can use wildcard characters (*, ?).
Set ignoreCase to True to ignore case sensitivity on compare.
If extendedCompare is True the filename can also contains the wildcard + and character ranges ([a,b,c] or [a-z]).
Wildcard + is same as * but at least one character must exist (* accepts empty strings).

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim fName As String
fName = MF_File.Find(File.DirInternal, "*.jpg", True, False)
End Sub
ListFiles (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean) As java.util.List
Returns a list of matching files from directory, the filename can use wildcard characters (*, ?).
Set ignoreCase to True to ignore case sensitivity on compare.
If extendedCompare is True the filename can also contains the wildcard + and character ranges ([a,b,c] or [a-z]).
Wildcard + is same as * but at least one character must exist (* accepts empty strings).

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim fList As List
fList = MF_File.ListFiles(File.DirInternal, "*.jpg", True, False)
End Sub
ListFiles2 (dirName As String, fileName As String, ignoreCase As Boolean, extendedCompare As Boolean, recursive As Boolean, includeFiles As Boolean, includeDirs As Boolean) As java.util.List
Returns a list of matching files from directory, the filename can use wildcard characters (*, ?).
Set ignoreCase to True to ignore case sensitivity on compare.
If extendedCompare is True the filename can also contains the wildcard + and character ranges ([a,b,c] or [a-z]).
Wildcard + is same as * but at least one character must exist (* accepts empty strings).
If resursive is True then subfolders will also scanned.
If listFiles is True then files will included in the result list.
If listDirs is True then directories will included in the result list.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim fList As List
fList = MF_File.ListFiles2(File.DirInternal, "*.jpg", True, False, True, True, False)
End Sub
MakePath (dirName As String, fileName As String) As String
Combines directory name and file name with correct separator.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
path = MF_File.MakePath(File.DirInternal, "first.jpg")
End Sub
Move (dirSource As String, fileSource As String, dirTarget As String, fileTarget As String, replaceExisting As Boolean) As Boolean
Move a file or directory.
Source path and target path can belong to different drive.
To overwrite a existing target, replaceExisting must be True.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_File.Move(File.DirInternal, "first.jpg", File.DirInternal, "second.jpg", True)
End Sub
PathSeparator As String
Returns the path separator (":" on Unix, ";" on Windows).

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim sep As String
sep = MF_File.PathSeparator
End Sub
Rename (dirSource As String, fileSource As String, dirTarget As String, fileTarget As String) As Boolean
Rename a file or directory.
Source path and target path must belong to the same drive.
The rename action fails if target exists.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_File.Rename(File.DirInternal, "first.jpg", File.DirInternal, "second.jpg")
End Sub
TempDir As String
Returns the temp directory.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
path = MF_File.TempDir
End Sub
UserDir As String
Returns the user home directory.

Example:
Sub Process_Globals
Dim MF_File As MF_File
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim path As String
path = MF_File.UserDir
End Sub

MF_Info


Events:

None

Members:


  JavaVersion As String

  Language As String

  Region As String

  SystemArchitecture As String

  SystemName As String

  SystemVersion As String

  Timezone As String

  UserName As String

Members description:

JavaVersion As String
Returns the java version.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim version As String
version = MF_Info.JavaVersion
End Sub
Language As String
Returns the two-letter language code of the default locale.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim lang As String
lang = MF_Info.Language
End Sub
Region As String
Returns the two-letter country code of the default locale.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim region As String
region = MF_Info.Region
End Sub
SystemArchitecture As String
Returns the system architecture.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim arch As String
arch = MF_Info.SystemArchitecture
End Sub
SystemName As String
Returns the name of the operating system.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim name As String
name = MF_Info.SystemName
End Sub
SystemVersion As String
Returns the operating system version.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim version As String
version = MF_Info.SystemVersion
End Sub
Timezone As String
Returns the default time zone.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim tz As String
tz = MF_Info.Timezone
End Sub
UserName As String
Returns the user name.

Example:
Sub Process_Globals
Dim MF_Info As MF_Info
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim user As String
user = MF_Info.UserName
End Sub

MF_Math


Events:

None

Members:


  CompareFloat (value1 As Double, value2 As Double, tolerance As Double, percent As Boolean) As Int

  CompareInt (value1 As Int, value2 As Int, tolerance As Int, percent As Boolean) As Int

  ConstrainFloat (value As Double, valueMin As Double, valueMax As Double) As Double

  ConstrainInt (value As Int, valueMin As Int, valueMax As Int) As Int

  EqualsFloat (value1 As Double, value2 As Double, tolerance As Double, percent As Boolean) As Boolean

  EqualsInt (value1 As Int, value2 As Int, tolerance As Int, percent As Boolean) As Boolean

  MapFloat (value As Double, inMin As Double, inMax As Double, outMin As Double, outMax As Double) As Double

  MapInt (value As Int, inMin As Int, inMax As Int, outMin As Int, outMax As Int) As Int

  RoundTo (value As Double, digits As Int) As Double

Members description:

CompareFloat (value1 As Double, value2 As Double, tolerance As Double, percent As Boolean) As Int
Compare two float numbers with tolerance.
Set percent to true and tolerance is used as pecentage value from value1/value2 average.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Int
result = MF_Math.CompareFloat(145.23, 145.0, 0.5, False)
End Sub
CompareInt (value1 As Int, value2 As Int, tolerance As Int, percent As Boolean) As Int
Compare two int numbers with tolerance.
Set percent to true and tolerance is used as pecentage value from value1/value2 average.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Int
result = MF_Math.CompareInt(1277, 1280, 5, False)
End Sub
ConstrainFloat (value As Double, valueMin As Double, valueMax As Double) As Double
Check the min and max value of a float number and correct if needed.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Double
result = MF_Math.ConstrainFloat(422.32, 32.0, 350.0)
End Sub
ConstrainInt (value As Int, valueMin As Int, valueMax As Int) As Int
Check the min and max value of a int number and correct if needed.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Int
result = MF_Math.ConstrainInt(231, 0, 255)
End Sub
EqualsFloat (value1 As Double, value2 As Double, tolerance As Double, percent As Boolean) As Boolean
Check if two float numbers are equal with tolerance.
Set percent to true and tolerance is used as pecentage value from value1/value2 average.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_Math.EqualsFloat(145.23, 145.0, 0.5, False)
End Sub
EqualsInt (value1 As Int, value2 As Int, tolerance As Int, percent As Boolean) As Boolean
Check if two int numbers are equal with tolerance.
Set percent to true and tolerance is used as pecentage value from value1/value2 average.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_Math.EqualsInt(1277, 1280, 5, False)
End Sub
MapFloat (value As Double, inMin As Double, inMax As Double, outMin As Double, outMax As Double) As Double
Map a float number from first min/max range to second min/max range.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Double
result = MF_Math.MapFloat(74.12, 32.0, 160.0, 12.0, 280.0)
End Sub
MapInt (value As Int, inMin As Int, inMax As Int, outMin As Int, outMax As Int) As Int
Map a int number from first min/max range to second min/max range.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Int
result = MF_Math.MapInt(347, 0, 1024, 0, 256)
End Sub
RoundTo (value As Double, digits As Int) As Double
Rounds a number.

Example:
Sub Process_Globals
Dim MF_Math As MF_Math
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Double
result = MF_Math.RoundTo(512.539583, 0.01)
End Sub

MF_String


Events:

None

Members:


  Append (str As String, appendStr As String, delimiter As String) As String

  BestLevenshtein (word As String, wordList As java.util.List, threshold As Double, ignoreCase As Boolean) As java.util.List

  Compare (str As String, pattern As String, ignoreCase As Boolean, extendedCompare As Boolean) As Boolean

  ContainsNumber (str As String) As Boolean

  Key (str As String) As String

  Key2 (str As String, delimiter As String) As String

  Left (str As String, num As Int) As String

  LevenshteinDistance (src As String, dest As String, ignoreCase As Boolean) As Int

  Mid (str As String, pos As Int, num As Int) As String

  Reverse (str As String) As String

  Right (str As String, num As Int) As String

  SetLength (str As String, len As Int, rightAdjust As Boolean, fill As Char) As String

  SizeToStr (size As Long, round As Boolean) As String

  StringOfChar (ch As Char, len As Int) As String

  TokenList (str As String, delim As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean) As java.util.List

  TokenList2 (str As String, delim As String, startQuotas As String, endQuotas As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean, includeQuotas As Boolean) As java.util.List

  TokenListList (lst As java.util.List, delim As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean) As java.util.List

  TokenListList2 (lst As java.util.List, delim As String, startQuotas As String, endQuotas As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean, includeQuotas As Boolean) As java.util.List

  Translate (str As String, translateOut As String, translateIn As String, fill As Char, ignoreCase As Boolean) As String

  Value (str As String) As String

  Value2 (str As String, delimiter As String) As String

Members description:

Append (str As String, appendStr As String, delimiter As String) As String
Append string on another string with delimiter. If the first string is empty, no delimiter is used.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim str As String
str = ""
str = MF_String.Append(str, "first", ";")
str = MF_String.Append(str, "second", ";")
str = MF_String.Append(str, "third", ";")
End Sub
BestLevenshtein (word As String, wordList As java.util.List, threshold As Double, ignoreCase As Boolean) As java.util.List
Compare the levenshtein distance between a word and all entries in a wordlist.
All entries with a score >= threshold (between 0.0 and 1.0) are part of the result list.
Set ignoreCase to true to ignore case sensitivity on compare.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim words As List
words.Initialize
words.Add("number")
words.Add("plumber")
words.Add("cucumber")
words.Add("")
Dim result As List
result = MF_String.BestLevenshtein("number", words, 0.7, True)
End Sub
Compare (str As String, pattern As String, ignoreCase As Boolean, extendedCompare As Boolean) As Boolean
Compares string with pattern, the pattern can use wildcard characters (*, ?).
Set ignoreCase to true to ignore case sensitivity on compare.
If extendedCompare ist true the pattern can also contains the wildcard + and character ranges ([a,b,c] or [a-z]).
Wildcard + is same as * but at least one character must exist (* accepts empty strings).

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_String.Compare("This is a test string", "*TEST*", true, false)
result = MF_String.Compare("This is my best string", "*[B,T]EST*", true, true)
End Sub
ContainsNumber (str As String) As Boolean
Check if a string contains numeric digit.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Boolean
result = MF_String.ContainsNumber("This is a number 1 string")
End Sub
Key (str As String) As String
Get the key from a string with format key=value.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Key("index=12")
End Sub
Key2 (str As String, delimiter As String) As String
Get the key from a string with format key delimiter value.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Key2("index:12", ":")
End Sub
Left (str As String, num As Int) As String
Get the left num chars of the given string.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Left("This is a string.", 6)
End Sub
LevenshteinDistance (src As String, dest As String, ignoreCase As Boolean) As Int
Calculate the levenshtein distance between two strings.
Set ignoreCase to true to ignore case sensitivity on calc.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As Int
result = MF_String.LevenshteinDistance("This is the first string", "This is the second string", True)
End Sub
Mid (str As String, pos As Int, num As Int) As String
Get num chars from the given string starting at pos.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Mid("This is a string.", 5, 4)
End Sub
Reverse (str As String) As String
Reverse the given string.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Reverse("This is a string.")
End Sub
Right (str As String, num As Int) As String
Get the right num chars of the given string.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Right("This is a string.", 5)
End Sub
SetLength (str As String, len As Int, rightAdjust As Boolean, fill As Char) As String
Set the length of the given string. The empty space is filled with the fill char.
If rightAdjust is True, the source string is right adjusted in the target string.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.SetLength("This is a string.", 32, True, "_")
End Sub
SizeToStr (size As Long, round As Boolean) As String
Converts the given number to string and formats it as size value (KB, MB, GB, ...).

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.SizeToStr(1024, True)
End Sub
StringOfChar (ch As Char, len As Int) As String
Returns a string of length len, filled with given char.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.StringOfChar("*", 32)
End Sub
TokenList (str As String, delim As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean) As java.util.List
Split a string at given delimiters.
If repeater is true then following delimiters will inspected as one delimiter.
If ignoreFirst is True then a empty string before the first delimiter will be ignored.
If ignoreLast is True then a empty string after the last delimiter will be ignored.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As List
result = MF_String.TokenList("This is the string", " ", True, True, True)
End Sub
TokenList2 (str As String, delim As String, startQuotas As String, endQuotas As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean, includeQuotas As Boolean) As java.util.List
Split a string at given delimiters.
If startQuotas and endQuotas are not empty, delimiters between quotas will be ignored.
If repeater is true then following delimiters will inspected as one delimiter.
If ignoreFirst is True then a empty string before the first delimiter will be ignored.
If ignoreLast is True then a empty string after the last delimiter will be ignored.
If includeQuotas is true then available quotas will included in the result.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As List
result = MF_String.TokenList2("This is 'the string'", " ", "'", "'", True, True, True, False)
End Sub
TokenListList (lst As java.util.List, delim As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean) As java.util.List
Split a list of strings at given delimiters.
If repeater is true then following delimiters will inspected as one delimiter.
If ignoreFirst is True then a empty string before the first delimiter will be ignored.
If ignoreLast is True then a empty string after the last delimiter will be ignored.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim data As List
Dim result As List
data.Add("This is string 1")
data.Add("This is string 2")
data.Add("This is 'string 3'")
result = MF_String.TokenListList(data, " ", True, True, True)
End Sub
TokenListList2 (lst As java.util.List, delim As String, startQuotas As String, endQuotas As String, repeater As Boolean, ignoreFirst As Boolean, ignoreLast As Boolean, includeQuotas As Boolean) As java.util.List
Split a list of strings at given delimiters.
If startQuotas and endQuotas are not empty, delimiters between quotas will be ignored.
If repeater is true then following delimiters will inspected as one delimiter.
If ignoreFirst is True then a empty string before the first delimiter will be ignored.
If ignoreLast is True then a empty string after the last delimiter will be ignored.
If includeQuotas is true then available quotas will included in the result.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim data As List
Dim result As List
data.Add("This is string 1")
data.Add("This is string 2")
data.Add("This is 'string 3'")
result = MF_String.TokenListList2(data, " ", "'", "'", True, True, True, False)
End Sub
Translate (str As String, translateOut As String, translateIn As String, fill As Char, ignoreCase As Boolean) As String
Translate or erase characters in string. Reimplementation of the 'translate' function from REXX.
The string will be searched for the characters in 'translateIn' and replaced with the characters in 'translateOut'.
If 'translateOut' is shorter as 'translateIn' or a empty string, the found characters are replaced with the 'fill' char.
If the 'fill' char is Zero, the characters will be deleted.
If 'translageIn' is a empty string, the string will be filled with 'fill' char or set to uppercase if 'fill' is zero.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Translate("This is the string", "oa", "ie", "", False)
End Sub
Value (str As String) As String
Get the value from a string with format key=value.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Value("index=12")
End Sub
Value2 (str As String, delimiter As String) As String
Get the value from a string with format key delimiter value.

Example:
Sub Process_Globals
Dim MF_String As MF_String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim result As String
result = MF_String.Value2("index:12", ":")
End Sub

Top