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
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,300,200, %WS_OverlappedWindow To hDlg
Control Add TextBox, hDlg, 200, "Line 1" + $CRLF + "Line 2" + $CRLF, 10,40,280,20
Control Add TextBox, hDlg, 300, "([0-9])$", 10,70,280,20
Control Add Button, hDlg, 100,"Search", 10,10,50,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local a$,b$,position&,length&
If CB.Msg = %WM_Command AND CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then
Control Get Text hDlg, 200 To a$
Control Get Text hDlg, 300 To b$
Do
position& = position& + length&
RegExpr b$ IN a$ AT position& TO _
position&, length&
? "Match at " + Str$(position&)
Loop While position&
End If
End Function
'gbs_01057
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm