| |
|
|
Nico Madysa | Hello, love Community!
enclosed one small Program, the one with quick with regulären squeeze out herumexperimentieren can. in the area for expressions can too dwelt any Escape-Sequenzen benutzen; if one means "\n" writes, becomes this too as Line break interprets.
enclosed one slight abweichender Code; in the code have I the Zeugs removes, with the I on Changes the Fenstergröße respond, because the over Subclassing and NProcs runs and a small shred How this plenty To far lead.
Download CompileMarkSeparation'Sorgt dafür, dass man in muster& auch Escapesequenzen benutzen kann.
proc EscapeBS
parameters text$
text$ = Translate$(text$,"\\z","\z")
text$ = Translate$(text$,"\\a","\a")
text$ = Translate$(text$,"\\b","\b")
text$ = Translate$(text$,"\\t","\t")
text$ = Translate$(text$,"\\f","\f")
text$ = Translate$(text$,"\\r","\r")
text$ = Translate$(text$,"\\n","\n")
text$ = Translate$(text$,"\\q","\q")
whileloop 0,255
text$ = Translate$(text$,"\\x"+upper$(Hex$(&loop \ 16)+Hex$(&loop mod 16)),Chr$(&loop))
EndWhile
return Translate$(text$,"\\\\","\\")
endproc
'Aktualisiert den Titel
proc BuildTitle
if GetText$(muster&) <> ""
WindowTitle "RegEx-Tester: %MatchPos=" + str$(%MatchPos) + "; %MatchLen=" + str$(%MatchLen)
else
WindowTitle "RegEx-Tester: Kein Ausdruck!"
endif
endproc
WindowTitle "RegEx-Tester"
cls
'Error-Level versetzt, weil sonst ständig Warnungen über
'Fehler im RegEx kommen
Set("ErrorLevel",0)
Cls External("User32","GetSysColor",15)
var Input& = Create("MultiEdit",%Hwnd,"Eingabe",0,0,width(%hWnd)\2,height(%hWnd)-20)
var Output& = Create("MultiEdit",%Hwnd,"Ausgabe",width(%hWnd)\2,0,width(%hWnd)\2,height(%hWnd)-20)
var muster& = Create("Edit",%Hwnd,"RegEx-Muster",0,height(%hWnd)-20,width(%hWnd),20)
whilenot Iskey(27)
waitinput
ifnot GetFocus(Output&)
if GetText$(muster&) <> ""
SetText Output&,Match$(EscapeBS(GetText$(muster&)),GetText$(input&))
endif
BuildTitle
endif
wend
ass=s4 href='./../../function-references/XProfan/end/'>end
Notes and corrections are, How always, Welcome. |
| 1.381 kB | | Version: | 1 | | Kurzbeschreibung: | Program to that Überprüfen of regulären squeeze out | | Hochgeladen: | 03/01/12 | | Downloadcounter: | | | | Download |
|
|
| |
|
|
|
| I faith if you in the hWnd-wProc with wm_eraseBkGnd 1 zurückgibst (return 1) then flickerts in Your example not at Skalieren. ^^ |
|
|
| |
|
|
|
Nico Madysa | this specific shred is very heavy of your Ratschlägen inspired what about me give with WM_ERASEBKGND already 1 back.
The Subclassproc sees so from: CompileMarkSeparation
nproc hWnd.Sub
parameters wnd&,msg&,wParam&,lParam&
var ud& = GetWindowLong(wnd&,gwl_userData)
if msg& = WM_WINDOWPOSCHANGING
ifnot Long(lParam&,24) & 1'Beachtet SWP_NOSIZE
var b& = dim(16)
GetClientRect(%hWnd,b&)
var a& = BeginDeferWindowPos(3)
a& = DeferWindowPos(a&,Long(ud&,0),0,\
0,0,Long(b&,8)\2,Long(b&,12)-20,SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER)
a& = DeferWindowPos(a&,Long(ud&,4),0,\
Long(b&,8)\2,0,Long(b&,8)\2,Long(b&,12)-20,SWP_NOACTIVATE|SWP_NOZORDER)
a& = DeferWindowPos(a&,Long(ud&,8),0,\
0,Long(b&,12)-20,Long(b&,8),20,SWP_NOACTIVATE|SWP_NOZORDER)
EndDeferWindowPos(a&)
Dispose(b&)
endif
return 0
elseif msg& = WM_GETMINMAXINFO
Long lParam&,24 = 320,240
return 0
elseif msg& = WM_ERASEBKGND
return 1
endif
return CallWindowProc(Long(ud&,nsc_wndproc),wnd&,msg&,wParam&,lParam&)
endproc
Dass there Verbesserungspotential exists, expect I geradezu. |
|
|
| |
|
|