Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
Enum Equates Singular
IDC_Button = 500
IDC_TextBox = 501
End Enum
Global hDlg As Dword
Function PBMain() As Long
Local style&
style& = %WS_TabStop Or %WS_Border Or %ES_Left Or %ES_AutoHScroll _
Or %ES_MultiLine Or %ES_NoHideSel Or %ES_WantReturn
Dialog New Pixels, 0, "PowerBASIC",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button,"Push", 50,10,100,20
Control Add TextBox, hDlg, %IDC_TextBox,"Declare Function TestA" + $CrLf + "Function TestA" + $CrLf + "End Function", 20,50,150,100, style&
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button
Local temp$, iPos As Long
Control Get Text hDlg, %IDC_TextBox To temp$
RegExpr "[^a-z ]function" In temp$ To iPos
RegExpr "[^ ]\bfunction" In temp$ To iPos
? Str$(iPos)
End Select
End Select
End Function
'gbs_01441
'Date: 10-17-2014
http://www.garybeene.com/sw/gbsnippets.htm