I am attempting to port an sqlite3 wrapper from Rapidq.
There are functions inside the type definition.
When I attempt to assign the return value to "Result" the compiler complains with "RESULT" not declared/unknown.
What is the proper way to return the results from a function inside a type definition or can i?
:-?
CODE:
Type SQLite3 As Panel
Databasepath As String
Commandtext As String
Handle As Long
StringSep As String
`onerror as event
SqLiteOK As Long
Function LibraryVersion() As String
Dim bchar As Byte, iCounter As Byte
Dim ptr_version As Long
Dim str_version As String
str_version=""
ptr_version = sqlite3_libversion()
icounter=0
Do
Memcopy(Varptr(bchar),ptr_version+icounter,1)
If bchar=0 Then Exit Do
str_version=str_version+Chr$(bchar)
Inc(icounter)
Loop
result = str_version
End Function
Function sq3_errorCode(errNumber As Long) As String
Dim errstr As String
Select Case errNumber
Case 1
errstr = "SQL syntax error or access to basic non-valid data: " + Chr$(13) + SQLite3.commandText
Case Else
errstr = "An error occured. SQL Error numver : "+Str$(errNumber)
End Select
`result = errstr
End Function
End Type
END CODE
Functions inside types
Functions inside types
Hi, this error occurred for me too. Bat It would be good to know the reason...
PaPi
PaPi
Functions inside types
For what it is worth, I think functions are not fully implanted in types.
but it can be used in this way, maybe you can something whit it.
``example code
type mytype as button
caption="click for color"
onclick=getc
function getcolor as integer
getcolor.result=rgb(255,0,0)
end function
sub getc
getcolor
caption=str$(getcolor.result)
end sub
end type
object myform as form
center
end object
dim mybutton as mytype
mybutton.parent=myform
myform.showmodal
but it can be used in this way, maybe you can something whit it.
``example code
type mytype as button
caption="click for color"
onclick=getc
function getcolor as integer
getcolor.result=rgb(255,0,0)
end function
sub getc
getcolor
caption=str$(getcolor.result)
end sub
end type
object myform as form
center
end object
dim mybutton as mytype
mybutton.parent=myform
myform.showmodal