The script is below, with line marked out for testing. And help would be appriecated
Code: Select all
Dialog>Dialog1
Caption=Dialog1
Width=341
Height=221
Top=120
Left=653
Edit=msEdit1,72,56,185,
Button=Continue,72,104,75,25,1
Button=Exit,176,104,75,25,2
Label=Enter the Key,128,32,true
EndDialog>Dialog1
Label>Dialog1loop
Show>Dialog1,r
If>r=1,testhekey
If>r=2,EOF
Goto>Dialog1loop
Label>testhekey
GoSub>Processkeyname
GoSub>Processkeynumber
SRT>Processkeynumber
/Let>Key=%Dialog1.msEdit1%
Input>Key,Test the Key
Length>%Key%,klen
Sub>%klen%,2
MidStr>%Key%,%klen%,3,Licenses
StringReplace>%Licenses%,SQ,,Licenses
StringReplace>%Licenses%,Q,,Licenses
Let>LNumber=
Let>Lcounter=1
Len>%Licenses%,llen
Add>llen,1
Label>ConvertNumberLine
MidStr>%licenses%,%Lcounter%,1,charread
GoSub>ConvertFrom
ConCat>LNumber,%Name%
Let>Lcounter=%Lcounter%+1
Endif
If>%Lcounter%=%llen%,DoneConvertingLicenseline
Goto>ConvertNumberLine
Label>DoneConvertingLicenseline
MDL>%LNumber%
END>Processkeynumber
SRT>Processkeyname
Input>Key,Test the Key
/Let>Key=%Dialog1.msEdit1%
/Let>Key=1PNGOAMKII1*KDHOG65G6Q71NQ1&
Let>Name1=
Let>counter=1
Len>%Key%,clen
Sub>%clen%,2
Label>StartConvertingLine
If>%counter%=2,SkipSub
If>%counter%=6,SkipSub
If>%counter%=10,SkipSub
If>%counter%=14,SkipSub
MidStr>%Key%,%counter%,1,charread
GoSub>ConvertFrom
ConCat>Name1,%Name%
Label>SkipSub
Let>counter=%counter%+1
If>%counter%=%clen%,DoneConvertingline
Goto>StartConvertingLine
Label>DoneConvertingline
MDL>Registered to %Name1% for %Lnumber% LIcenses
END>Processkeyname
SRT>ConvertFrom
If>%charread%=Q
Let>Name=A
Goto>convertedChar
Endif
If>%charread%=P
Let>Name=B
Goto>convertedChar
Endif
If>%charread%=O
Let>Name=C
Goto>convertedChar
Endif
If>%charread%=N
Let>Name=D
Goto>convertedChar
Endif
If>%charread%=1
Let>Name=E
Goto>convertedChar
Endif
If>%charread%=M
Let>Name=F
Goto>convertedChar
Endif
If>%charread%=2
Let>Name=G
Goto>convertedChar
Endif
If>%charread%=L
Let>Name=H
Goto>convertedChar
Endif
If>%charread%=K
Let>Name=I
Goto>convertedChar
Endif
If>%charread%=3
Let>Name=J
Goto>convertedChar
Endif
If>%charread%=J
Let>Name=K
Goto>convertedChar
Endif
If>%charread%=I
Let>Name=L
Goto>convertedChar
Endif
If>%charread%=4
Let>Name=M
Goto>convertedChar
Endif
If>%charread%=H
Let>Name=N
Goto>convertedChar
Endif
If>%charread%=G
Let>Name=O
Goto>convertedChar
Endif
If>%charread%=5
Let>Name=P
Goto>convertedChar
Endif
If>%charread%=F
Let>Name=Q
Goto>convertedChar
Endif
If>%charread%=6
Let>Name=R
Goto>convertedChar
Endif
If>%charread%=E
Let>Name=S
Goto>convertedChar
Endif
If>%charread%=7
Let>Name=T
Goto>convertedChar
Endif
If>%charread%=D
Let>Name=U
Goto>convertedChar
Endif
If>%charread%=W
Let>Name=V
Goto>convertedChar
Endif
If>%charread%=C
Let>Name=W
Goto>convertedChar
Endif
If>%charread%=9
Let>Name=X
Goto>convertedChar
Endif
If>%charread%=B
Let>Name=Y
Goto>convertedChar
Endif
If>%charread%=A
Let>Name=Z
Goto>convertedChar
Endif
If>%charread%=*
Let>Name=
Goto>convertedChar
Endif
If>%charread%=+
Let>Name=0
Goto>convertedChar
Endif
If>%charread%=!
Let>Name=9
Goto>convertedChar
Endif
If>%charread%=@
Let>Name=8
Goto>convertedChar
Endif
If>%charread%=#
Let>Name=7
Goto>convertedChar
Endif
If>%charread%=&
Let>Name=6
Goto>convertedChar
Endif
If>%charread%=R
Let>Name=5
Goto>convertedChar
Endif
If>%charread%=T
Let>Name=4
Goto>convertedChar
Endif
If>%charread%=?
Let>Name=3
Goto>convertedChar
Endif
If>%charread%=Z
Let>Name=2
Goto>convertedChar
Endif
If>%charread%=X
Let>Name=1
Label>convertedChar
Endif
END>ConvertFrom
Label>EOF