Anterior Sumário Próximo OpenBASE! o Banco de Dados inteligente. Fale conosco!

Exemplos utilizando DLLs

Nos exemplos a seguir:

Programa OpusWin

$dll=teste1.dll

static prim(l)

func abre

parameters ok

database EXEMPLO 1 a 2

if dberr()=0

  ok="s"

else 

  ok="n"

endif

prim=.f.

return 0

func leseq

parameters nome, idadp

database EXEMPLO 1 a 2

use PESSOA

if .not. prim

  prim=.t.

  locate

else

  continue

endif

if  eof()

  nome=""

  return 1

endif

nome=NOME.P

idadp=str(IDADE,3)

return 0

Script Visual Basic:

Private Declare Function abre Lib "\win\tsgbd\facil\opuwin\teste1.dll" (ByVal ok As String, ByVal tok As Integer) As Integer

Private Declare Function leseq Lib "\win\tsgbd\facil\opuwin\teste1.dll" (ByVal nome As String, ByVal tnome As Integer, ByVal idade As String, ByVal tidade As Integer) As Integer

Private Sub Command1_Click()

Dim ok As String * 3

Dim nome As String * 10

Dim idad As String * 3

Dim r As Integer

r = abre(ok, 3)

if  ok = "n

  msgbox …..

  exitsub

EndIf

r = leseq(nome, 10, idad, 3)

i = 0

text1.Text = ""

While r = 0 And i < 10

  text1.Text = text1.Text + " " + nome + " " + idad

  r = leseq(nome, 10, idad, 3)

  i = i + 1

Wend

End Sub

Anterior Sumário Próximo OpenBASE! o Banco de Dados inteligente. Fale conosco!