English
Source / code snippets

Kreditkartennummer Verify

 

ByteAttack
who it need...
CLS
/*
Kreditkartennummer Verify
temporary only:
American Express
MasterCard
EuroCard
VISA
*/

Proc CheckCard

    Parameters KN$
    var Lang&=len(KN$)
    Declare Index&,Nr$,Zaehler&,Gesamt&
    var Multi&=1

    WhileNot Index&=Lang&

        Nr$=Mid$(KN$,Lang&-Index&,1)

        if Multi&=1

            Zaehler&=val(Nr$)
            Multi&=2

        else

            Zaehler&=val(Nr$)*2
            Multi&=1

        endif

        Inc Index&

        if len(Str $(Zaehler&))=2

            Gesamt&=Gesamt&+val(left$(Str $(Zaehler&),1))+val(right$(Str $(Zaehler&),1))

        else

            Gesamt&=Gesamt&+Zaehler&

        endif

    EndWhile

    var PZ&=10-(Gesamt& MOD 10)

    if Str $(PZ&)=right$(KN$,1)

        Print "gültig"

    else

        Print "ungültig"

    endif

Endproc

'example:
CheckCard "468345782937652"' gültige number
CheckCard "4683457829376529"' ungültige number
Waitinput
 
XProfan X3
Website:  [...] 
Facebook:  [...] 
12/29/15  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.624 Views

Untitledvor 0 min.
Normann Strübli02/03/23
Thomas Zielinski12/18/22
RGH12/26/21
p.specht11/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

ByteAttack (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