English
Forum

Edit input alphanum num alpha

 

Ernst
Edit-input retrenching on defined desired characters, alphanumeric, only Digits, only letters + sostige characters
Var __edE& = 0' ( 0 = alphanumeric / 1 = numerisch  / 2 = aplpha )
Var AlphaNum$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,.%()/ "' input limited on available characters

Proc Edit_EingabeAuswertung

    Declare txt$

    Select InStr(right$(gettext$(Edit&),1),AlphaNum$)

        CaseOf  1,2,3,4,5,6,7,8,9,10

        IF __edE&=2

            txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
            settext Edit&, txt$
            sendmessage(Edit&,$B1,len(txt$),len(txt$))

        endif

        CaseOf > 10

        IF __edE&=1

            txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
            settext Edit&, txt$
            sendmessage(Edit&,$B1,len(txt$),len(txt$))

        endif

        otherwise
        txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
        settext Edit&, txt$
        sendmessage(Edit&,$B1,len(txt$),len(txt$))

    EndSelect

ENDPROC

' -----------------------------------------------------------
windowstyle 8 + 512
Window 200,200-500,300
CLS RGB(212,210,200)
Var Edit& = Create("Edit",%hwnd,"",20,100,200,20)
setstyle Edit&,getstyle(Edit&) + $8
Var b_1&= Create("Button",%hwnd,"alphanum",10,150,80,30)
Var b_2&= Create("Button",%hwnd,"num",120,150,80,30)
Var b_3&= Create("Button",%hwnd,"alpha",230,150,80,30)
Var txt_1& = Create("TEXT",%hwnd,"alphanum",20,60,80,30)
Var txt_2& = Create("TEXT",%hwnd,"",100,60,200,30)
setfocus(Edit&)

While 1

    Waitinput

    IF %key = 2

        break

    ElseIf %key = 13

        settext txt_2&, gettext$(Edit&)
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_1&)

        __edE& = 0
        settext txt_1&, "alphanum"
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_2&)

        __edE& = 1
        settext txt_1&, "         num"
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_3&)

        __edE& = 2
        settext txt_1&, "alpha"
        setfocus(Edit&)
        settext Edit&, ""

    EndIf

    Edit_EingabeAuswertung

EndWhile

 
04/26/16  
 




RudiB.


works not yet so integrally....but otherwise super...

22 kB
Hochgeladen:04/27/16
Downloadcounter150
Download
 
FreeProfan
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
04/27/16  
 




Ernst
How is the with you zustandegekommen ?
I hab's zig-time durchprobiert (too over xpse) - no Error.
FreeProfan / FreeProfan Interpreter 0.9-32 (on the Interpreter kann's still not lying)
have irgendeine supposition what rotten is or his could ??
 
04/27/16  
 




funkheld
by me works it fehlerfrei with XPSE.
XprofanX3

lying on the Freeprofan.

greeting
 
04/27/16  
 



@serious: Vmtl. strg+v etc.,

vlt. could a usermessage wm_keydown = 256 remedy create,
to hardship too waitinput 333 testing.
 
04/27/16  
 




Ernst
Hello If
Presumably = Bingo
once I with strg+v More as a letters einfüge, becomes the last deleted, but the others are drin
How bekomm I the Schmarren lane
with usermessage or. waitinput come I do not moreover

with iskey-request can I the Insert by strg+v prevent, but z.B. not rights Mouse button / insert
Var __edE& = 0' ( 0 = alphanumeric / 1 = numerisch  / 2 = aplpha )
Var AlphaNum$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,.%()/ "' input limited on available characters

Proc Edit_EingabeAuswertung

    Declare txt$

    Select InStr(right$(gettext$(Edit&),1),AlphaNum$)

        CaseOf  1,2,3,4,5,6,7,8,9,10

        IF __edE&=2

            txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
            settext Edit&, txt$
            sendmessage(Edit&,$B1,len(txt$),len(txt$))

        endif

        CaseOf > 10

        IF __edE&=1

            txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
            settext Edit&, txt$
            sendmessage(Edit&,$B1,len(txt$),len(txt$))

        endif

        otherwise
        txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
        settext Edit&, txt$
        sendmessage(Edit&,$B1,len(txt$),len(txt$))

    EndSelect

ENDPROC

' -----------------------------------------------------------
windowstyle 8 + 512
Window 200,200-500,300
CLS RGB(212,210,200)
Var Edit& = Create("Edit",%hwnd,"",20,100,200,20)
setstyle Edit&,getstyle(Edit&) + $8
Var b_1&= Create("Button",%hwnd,"alphanum",10,150,80,30)
Var b_2&= Create("Button",%hwnd,"num",120,150,80,30)
Var b_3&= Create("Button",%hwnd,"alpha",230,150,80,30)
Var txt_1& = Create("TEXT",%hwnd,"alphanum",20,60,80,30)
Var txt_2& = Create("TEXT",%hwnd,"",100,60,200,30)
setfocus(Edit&)
Var E_txt$ =""

While 1

    E_txt$ = gettext$(Edit&)
    Waitinput

    IF %key = 2

        break

    ElseIf %key = 13

        settext txt_2&, gettext$(Edit&)
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_1&)

        __edE& = 0
        settext txt_1&, "alphanum"
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_2&)

        __edE& = 1
        settext txt_1&, "         num"
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_3&)

        __edE& = 2
        settext txt_1&, "alpha"
        setfocus(Edit&)
        settext Edit&, ""

    EndIf

    IFnot iskey(17) & iskey(86)

        Edit_EingabeAuswertung

    Else

        settext Edit&, E_txt$
        sendmessage(Edit&,$B1,len(E_txt$),len(E_txt$))

    EndIf

EndWhile

 
04/27/16  
 




Ernst
i think I hab's hinbekommen
Var __edE& = 0' ( 0 = alphanumeric / 1 = numerisch  / 2 = aplpha )
Var AlphaNum$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,.%()/ "' input limited on available characters
' -----------------------------------------------------------

Proc Edit_EingabeAuswertung

    Declare txt$
    Var x% = 1

    Select __edE&

        CaseOf 0: txt$ = AlphaNum$

        CaseOf 1: txt$ = left$(AlphaNum$,10)

        CaseOf 2: txt$ = right$(Alphanum$,len(AlphaNum$)-10)

    EndSelect

    whileloop len(getclip$())

        IF InStr(mid$(getclip$(),x%,1),txt$) > 0

            inc x%

        Else

            clearclip
            break

        EndIf

    EndWhile

    if InStr(right$(gettext$(Edit&),1),txt$) = 0

        txt$=left$(gettext$(Edit&),len(gettext$(Edit&))-1)
        settext Edit&, txt$
        sendmessage(Edit&,$B1,len(txt$),len(txt$))

    endif

ENDPROC

' -----------------------------------------------------------
windowstyle 8 + 512
Window 200,200-500,300
CLS RGB(212,210,200)
Var Edit& = Create("Edit",%hwnd,"",20,100,200,20)
setstyle Edit&,getstyle(Edit&) + $8
Var b_1&= Create("Button",%hwnd,"alphanum",10,150,80,30)
Var b_2&= Create("Button",%hwnd,"num",120,150,80,30)
Var b_3&= Create("Button",%hwnd,"alpha",230,150,80,30)
Var txt_1& = Create("TEXT",%hwnd,"alphanum",20,60,80,30)
Var txt_2& = Create("TEXT",%hwnd,"",100,60,200,30)
setfocus(Edit&)

While 1

    Waitinput

    IF %key = 2

        break

    ElseIf %key = 13

        settext txt_2&, gettext$(Edit&)
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_1&)

        __edE& = 0
        settext txt_1&, "alphanum"
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_2&)

        __edE& = 1
        settext txt_1&, "         num"
        setfocus(Edit&)
        settext Edit&, ""

    ElseIf clicked(b_3&)

        __edE& = 2
        settext txt_1&, "alpha"
        setfocus(Edit&)
        settext Edit&, ""

    EndIf

    Edit_EingabeAuswertung

EndWhile

 
04/28/16  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.438 Views

Untitledvor 0 min.
H.Brill11/13/22
Walter03/30/19
Ernst04/10/17
rquindt11/18/16
More...

Themeninformationen

this Topic has 4 subscriber:

Ernst (4x)
iF (1x)
RudiB. (1x)
funkheld (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie