Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
#Include "Win32API.inc"
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",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 WordChar, BadChar, MainString As String
If Cb.Msg = %WM_Command And Cb.Ctl = 100 And Cb.CtlMsg = %BN_Clicked Then
WordChar = Chr$(32, 48 To 57,65 To 90,97 To 122) 'numbers/letters
? WordChar
BadChar = Remove$(Chr$(33 To 255), Any WordChar) 'everything else
? BadChar
MainString = "Now the-dog is @#$%^ not there."
MainString = Remove$(MainString, Any BadChar)
? MainString
MainString = "Now the-dog is @#$%^ not there."
Replace Any BadChar With Space$(Len(BadChar)) In MainString$
? MainString
End If
End Function
'gbs_01362
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm