
Objetivo e utilização:
Grava em um arquivo local (parametro saída) um item memo (parametro item) de um determinado arquivo (parametro arq).
Sintaxe:
PegaGravaItemMemo (char *arq, char *item, char*saida)
Parâmetros:
Exemplos:
Sub list_depart_DblClick ()
If Len(Dir("c:\dlls\temp.txt")) <> 0 Then
Kill "c:\dlls\temp.txt"
End If
If Len(Dir("c:\dlls\temp.bmp")) <> 0 Then
Kill "c:\dlls\temp.bmp"
End If
Dim buffer As String * 6
Dim howmany As Long
ReDim items(2) As itens
‘posiciona no registro
items(0).item = "dept_code"
items(1).item = ""
aa = ObtemRegistrosNoArquivo("dept")
result = ReiniciaSequencial("dept")
For i = 1 To aa
result = LeProximoSequencial("dept", items(0), buffer)
If Mid(buffer, 1, 6) = Mid(list_depart.List(list_depart.ListIndex), 1, 6) Then
Exit For
End If
Next i
frm_edit.MousePointer = 11
‘Lê arquivo de descrição do departamemto e grava num arquivo local
result = ObtemTamanhoMemo("dept", "dept_desc", howmany)
result = PegaGravaItemMemo("dept", "dept_desc", c:\dlls\temp.txt")
If FileLen("c:\dlls\temp.txt") <> 0 Then
edit_desp.Text = Space(0)
Dim tempchar As String * 1000
Open "c:\dlls\temp.txt" For Binary Access Read As #1
Do While Not EOF(1)
Get #1, , tempchar
edit_desp.Text = edit_desp.Text + tempchar
Loop
Close #1
Else
edit_desp.Text = Space(0)
End If
song1.Caption = "tamanho da descrição do departamento:" + Str(howmany)
***Este bloco do programa é usado para a função PegaGravaItemMemo***********
result = ObtemTamanhoMemo("dept", "dept_music", howmany)
result = PegaGravaItemMemo("dept", "dept_music", "c:\dlls\temp.BMP")
If FileLen("c:\dlls\temp.bmp") <> 0 Then
frm_edit.Image_music.Picture = LoadPicture("c:\dlls\temp.bmp")
Else
frm_edit.Image_music.Picture = LoadPicture()
End If
song2.Caption = "tamanho da musica do departamento:" + Str(howmany)
frm_edit.MousePointer = 0
End Sub
