Date: 02-16-2022
Return to Index
created by gbSnippets
'The snippets supplied with gbSnippets generally consist of 3 sections:
'- Introductory text/reference material
'- Primary code section which lists and discusses the key code that
' makes the snippet perform its primary task
'- Compilable Example which can be opened in the PowerBASIC IDE (F4)
' or in the PowerBASIC compiler (F5)
'However, you can put pretty much put whatever you want into each
'snippet. The only real requirement is that to use the options
'to put a snippet into the PowerBASIC IDE or to compile the snippet
'you must put the executable code below the following line, as
'shown in this example.
'Compilable Example: (Jose Includes)
'This simple example minimizes when you press the button.
#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",300,300,200,200,%WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local x As Long
If CB.Msg = %WM_Command AND CB.Ctl = 100 Then
Select Case x
Case 5 : x = 2
case 10 : Exit Function
End Select
If x = 2 then
x = 7
else
x = 5
End If
End If
End Function
'gbs_00002 unique number assigned to each snippet
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm