Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As Dword, MyArray() As Long
Function PBMain() As Long
Dialog New Pixels, 0, "Array Read/Write Test Code",300,300,240,200, %WS_OverlappedWindow To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local i As Long
Select Case Cb.Msg
Case %WM_InitDialog
ReadArray 'or, you app loads the array somewhere
Case %WM_Destroy
SaveArray
End Select
End Function
Sub SaveArray
Open "myarray.dat" For Binary As #1
Put #1,, MyArray()
Close #1
? "Array saved!"
End Sub
Sub ReadArray
Dim MyArray(10) 'note the array size is 10 in this sample code
Open "myarray.dat" For Binary As #1
Get #1,, MyArray()
Close #1
? "Array read!"
End Sub
'gbs_00765
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm