Date: 02-16-2022
Return to Index
created by gbSnippets
'gbFind is a freeware program of mine. It basically stores anything text and
'allows the user to search for stored information. I've pretty much abandoned
'it in favor of gbSnippets, but wrote this code to convert the gbFind text file
'to a format compatible with gbSnippets.
'Primary Code:
'gbFind data consists of one of more text lines. A line preceded by "-----" is
'treated as part of the preceding line. The code to parse gbFind files and
'convert to gbSnippets is given in the callback function below (resonse to a
'button click).
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg as DWord
Function PBMain() As Long
Local Style&
style& = %WS_Child Or %WS_Visible Or %ES_MultiLine Or %WS_VScroll Or %ES_AutoHScroll _
Or %WS_HScroll Or %ES_AutoVScroll Or %ES_WantReturn Or %WS_TabStop
Dialog New Pixels, 0, "Test Code",300,300,200,300, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Control Add TextBox, hDlg, 200,"", 10,35,180,200, Style&
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If CB.Msg = %WM_Command AND CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then
Local d$, temp$, iCount&
Open "all.txt" For Input as #1
While IsFalse(Eof(1))
Line Input #1, d$
If Left$(d$,5) = "-----" Then
temp$ = temp$ + $crlf + Mid$(d$,6)
Incr iCount&
Else
If Trim$(d$) <> "" Then
temp$ = temp$ + $crlf + "++-" & "-;;" & $crlf + "1" + $crlf + d$
End If
End If
Wend
Close #1
Control Set Text hdlg, 200, temp$
MsgBox Str$(icount&)
End If
End Function
'gbs_00482
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm