Table of Contents

OBJECTS

String

The Qt documentation in C++ of this class (QString) can be read here: http://doc.trolltech.com/4.4/qstring.html

Unicode support is implemented since V1.69i.

KBasic comes with two string types.

You need to have installed Unicode support (e.g. Asian language and character sets) for Windows for this feature.

If a function accepts several string expressions and the first string expression is of type String (Unicode), all other expressions of type CString are converted to unicode using the local 8 bit character set automatically.

Reading and writing strings. If you use the String data type, the string data is encoded as UTF8 (like the KBasic's source codes within KBasic's IDE). But if you use CString, the data is treated as local 8 bit ASCII, which is useful for compatibility reasons to make old code working.

It is possible to use UTF16 for Windows API calls. To do so, use a CString and the function UTF16 to convert from String to CString.

If a Framework class method uses a String datatype it is actually internally Unicode QString, not a 8 Byte CString.

The 'String' class is a special class, so you do not need to instantiate it with 'New', because it is automatically done for you by KBasic.

Methods are

Implemented since KBasic V1.6 (l):

Implemented since KBasic V1.77:

Reads from a user defined type, length bytes of memory into a string.

Writes from a string into a user defined type (length bytes).

Example

Type _udf
  Name As CString * 3
  Sec As CString * 6
End Type
Dim udf As _udf

Dim s As String = File.ReadBinary("C:\fish2.gif")

s.Poke(udf, Len(udf))
Print Left(udf.Name, 3)
Print Left(udf.Sec, 6)
    
s = ""
Peek(s, udf, Len(udf))
Print "-->" & Left(s, Len(udf))

Implemented since KBasic V1.77

Possible values for SectionFlags

SectionDefaultEmpty fields are counted, leading and trailing separators are not included, and the separator is compared case sensitively.
SectionSkipEmptyTreat empty fields as if they don't exist, i.e. they are not considered as far as start and end are concerned.
SectionIncludeLeadingSepInclude the leading separator (if any) in the result string.
SectionIncludeTrailingSepInclude the trailing separator (if any) in the result string.
SectionCaseInsensitiveSepsCompare the separator case-insensitively.

Implemented since KBasic V1.78

Implemented since KBasic V1.79

Not implemented yet:

Print Escape(“this %1 is a miracle of %2\n”, “2333”, “erewr”)

\n werden erstetzt mit “CR”


Strings

The Qt documentation in C++ of this class (QStringList) can be read here: http://doc.trolltech.com/4.4/qstringlist.html

Implemented since KBasic V1.6 (l).

Methods are

Array

Implemented since KBasic V1.78.

Example

Dim k As New Strings

k{1} = "Hello"
k{2} = "World"

For Each s As String In k
  Print s
Next

MsgBox k{1}

Not implemented yet:


Dictionary

The Qt documentation in C++ of this class (QMap) can be read here: http://doc.trolltech.com/4.4/qmap.html

Implemented since KBasic V1.78.

Methods are

Array

Returns the current key. Only use it in a For Each Next loop.

Returns the current value. Only use it in a For Each Next loop.

Not implemented yet:


Binary

The keyword 'Binary' is reserved for future versions of KBasic.

See String for an overview how to deal with binary data.

It enables you to read and write binary data in memory, storing and loading results from the file system.


Array

The Qt documentation in C++ of this class (QMap) can be read here: http://doc.trolltech.com/4.4/qmap.html

Implemented since KBasic V1.78.

KEY means

Key As Variant = ””, Key2 As Variant = ””, Key3 As Variant = ””, Key4 As Variant = ””, Key5 As Variant = ””, Key6 As Variant = ””, Key7 As Variant = ””, Key8 As Variant = ””

Array

Example

Dim t As Array = New Array()
  
t{"Name"} = "Julie Hepp"
Print t{"Name"}

t{"a", "Person", 123} = "Bernd Noetscher"
Print t{"a", "Person", 123}

Not implemented yet:

Methods are

Returns the current key. Only use it in a For Each Next loop.

Returns the current value. Only use it in a For Each Next loop.


Bits

The Qt documentation in C++ of this class (QBitArray) can be read here: http://doc.trolltech.com/4.4/qbitarray.html

Implemented since KBasic V1.78.

Remember Byte is 8 bit, Short is 16 bit and Integer is 32 bit.

Not implemented yet:


DateTime

Implemented since KBasic V1.78

The 'DateTime' class is a special class, so you do not need to instantiate it with 'New', because it is automatically done for you by KBasic.

Methods are


Err

Properties are

Methods are

Not implemented yet:

LastDllError


Event

Declare this class in class file myEvent. It is used to receive several special events.

If you set a form to be automatically started on runtime in project properties, the events will not dispatched.

Class myEvent Inherits Event
    
  ' the following event handlers are possible

  Sub Forms_OnFormGotFocus(FormName As String)    
    Print "Forms_OnFormGotFocus! " & FormName    
  End Sub 
  
  
End Class