Node:Summary of the interface functions, Previous:Examples, Up:Visual Basic
In this section you will find a summary of the functions and procedures of the Visual Basic interface:
Function PrologOpenQuery (ByVal Goal As String) As Long
Sub PrologCloseQuery (ByVal qid As Long)
qid
.
Important: if qid
is not the innermost query (i.e. the one
opened last), then all more recently opened queries are closed as well.
Function PrologNextSolution(ByVal qid As Long) As Integer
qid
. Returns 1 on success, 0 on failure, -1 on
error. In case of an erroneous execution, the Prolog exception raised
can be retrieved with the PrologGetException
procedure.
Important: Several queries may be open at the same time, however, if
qid
is not the innermost query, then all more recently
opened queries are implicitly closed.
Function PrologGetLong(ByVal qid As Long, ByVal VarName As String, Value As Long) As Integer
Value
the integer value bound to the variable
VarName
of the query identified by qid
, as an integer.
That is, the value of the given variable is converted to an integer.
Returns 1 on success, i.e. if the given goal assigned an integer value
to the variable; otherwise, it returns 0. If an error occurred it returns
-1, e.g. if an invalid qid
was used.
Function PrologGetString(ByVal qid As Long, Val VarName As String, Value As String) As Integer
Value
the string value bound to a variable
VarName
of the query, as a string. That is, the value assigned
to the given variable is written out into an internal stream by the
write/2
Prolog predicate, and the characters output to this
stream will be transferred to Visual Basic as a string. Retuns 1 on
success, i.e. if the given goal assigned a value to the variable;
otherwise, it returns 0. If an error occurred it returns
-1, e.g. if an invalid qid
was used.
Function PrologGetStringQuoted(ByVal qid As Long, ByVal VarName As String, Value As String) As Integer
PrologGetString
, but conversion uses Prolog
writeq/2
. Returns 1 on success, i.e. if the given goal assigned
a value to the variable; otherwise, it returns 0. If an error occurred it
returns -1, e.g. if an invalid qid
was used.
Function PrologQueryCutFail (ByVal Goal As String) As Integer
Sub PrologGetException(ByRef Exc As String)
Exc
string as if written by the writeq/2
predicate. If there is no
exception available then the empty string is returned.
Function PrologInit() As Long