Tutorial
Using mdTypes [EN]
von MOD | Seite 5 von 12 |
Wrapping classes:
- md/lang/mdObject
-- md/lang/mdString
-- md/lang/mdInteger
-- md/lang/mdBoolean
mdObject is the base class for all mdTypes. It does define some basic virtual methods. Usually, you don't need this class in FreeBASIC.
mdString is a String wrapper with methods like replace() and split(). Example:
#Include Once "md/lang/mdString.bi"
Dim As String array()
Dim As mdString s = "Please replace all 'i' with 'I' and split this into an array"
s = s.replace("i", "I")
s.split(array(), " ")
For i As Integer = LBound(array) To UBound(array)
Print i, array(i)
Next
Sleep
mdInteger is a Integer wrapper. It is designed as a replacement for FreeBASICs Integer, which can't be used in collections (see above). Example:
#Include Once "md/lang/mdInteger.bi"
Dim As mdInteger i = 5
i += 10
Print i, Str(i)
Sleep
mdBoolean is a wrapper for a non-existing FreeBASIC boolean type. You can use it for TRUE/FALSE values. Example:
#Include Once "md/lang/mdBoolean.bi"
Dim As mdBoolean b = (0 = 1)
Print b, b.toString()
b = (b = b)
Print b, b.toString()
b = "FALSE"
Print b, b.toString()
Sleep
Zusätzliche Informationen und Funktionen | |||||||
---|---|---|---|---|---|---|---|
|