Foro | | | | - Página 1 - |
|  Julian Schmidt | ¡Hola, Yo versuche gerade Pagar en un Buchstabenreihe a konvertieren. Diese debería una ähnliches Formato haben como en Excel.
A,B,C,D,E... AA,AB,AC,AD,AE... BA,BB,BC,BE... ZA,ZB,ZC... AAA,AAB... ABA,ABB... ZZY, ZZZ... AAAA, AAAB... Das lo salvo zwei Buchstabenreihen funktioniert Yo ya hingekommen. Mir fehlt aber irgendwie una Ansatz cómo hacerlo más hoch rechnen kann. Yo bräuchte auch una Gegen-Función.
cls
var lbox&=Crear("ListBox", %hwnd, 0, 0, 0, width(%hwnd), height(%hwnd))
whileloop 26*30
AddStrings(lbox&,LetterOfNumber(&bucle,1))
Endwhile
mientras que 1
waitinput
caso iskey(27) : end
Settext %hwnd,Str$(GetCurSel(lbox&))+" - "+GetString$(lbox&,GetCurSel(lbox&))
Endwhile
Proc LetterOfNumber
Parámetros number%,grossschreibung%
caso grossschreibung%=1 : var alphabet$="A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
caso grossschreibung%<>1 : var alphabet$="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"
declarar texto$,ausnahme%
mientras que number%<>0
if number%<27
texto$=texto$+Substr$(alphabet$,number%,",")
number%=0
más
whileloop Round(number%/26,0)
if number%=(26*&bucle)
texto$=Substr$(alphabet$,IF(Val(Substr$(Str$(number%/26),1,"."))-1>0,Val(Substr$(Str$(number%/26),1,"."))-1,1),",")+Substr$(alphabet$,26,",")
ausnahme%=1
Endif
Endwhile
caso ausnahme%<>1 : texto$=Substr$(alphabet$,Val(Substr$(Str$(number%/26),1,".")),",")+texto$
number%=number%-(26*Val(Substr$(Str$(number%/26),1,".")))
Endif
Endwhile
Volver texto$
ENDPROC
LG
Julian57 |
| | | ˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗ Webseite [...]  | 08.10.2011 ▲ |
| |
|  | « Dieser Contribución wurde como Solución gekennzeichnet. » | | - Página 4 - |
|  Jörg Sellmeyer | Lo ha me no Ruhe gelassen y yo tener todavía weitergetüftelt. Jetzt tener ich's fuera y es letztlich unkomplizierter como anfangs esperado.
'y umgekehrt
'Jörg Selllmeyer 2011
'a freien Verwendung
'hier bekommt uno muy bien erklärt, como el Umrechnen de Pagar en un otro Base funktioniert:
'https://www.arndt-bruenner.de/mathe/scripts/Zahlensysteme.htm
'El Schwierigkeit hierbei, Es el fehlende Null. Alle Nullstellen necesario abgefangen voluntad, el
'aktuelle Punto en eins verringert y el folgende Punto ebenfalls en eins verringert voluntad.
'Der Valor A000 se entonces also sin Nullen a YYZ. C000 se a BYYZ
Proc Nr2ABC
Parámetros Zahl!
Declarar Valor$,Rest%
Mientras que Zahl! > 0
Rest% = Zahl! Mod 26
Zahl! = Zahl! \ 26
If Rest% = 0
'hier voluntad el Nullstellen abgefangen y umgewandelt
Zahl! = Zahl! -1
Rest% = 26
EndIf
Case Rest% > 0:Valor$ = Chr$(Rest% + 64) + Valor$
Wend
Volver Valor$
ENDPROC
Proc ABC2Nr
Parámetros Texto$
Declarar Zahl!,Summe!,B$
Texto$ = Upper$(Texto$)
WhileLoop Len(Texto$),1,-1
B$ = Substr$(Texto$,-&Loop)
Zahl! = (Ord(B$)-64) * 26^(&Loop-1)
Summe! = Summe! + Zahl!
Wend
Volver Int(Summe!)
ENDPROC
Cls
Título de la ventana "Zahlen en Buchstaben umwandeln y umgekehrt"
Imprimir "LQSVOFKGQM =", ABC2Nr("LQSVOFKGQM")
Imprimir "AAAAAA =", ABC2Nr("AAAAAA")
Imprimir "ABCDEFGH =", ABC2Nr("ABCDEFGH")
Imprimir
Imprimir "XPROFAN macht Spass =", ABC2Nr("XPROFAN"),ABC2Nr("macht"),ABC2Nr("Spass")
Imprimir
Declarar s$
Selección aleatoria
WhileLoop 10
s$ = Chr$(Rnd(26) + 65) + s$
Wend
Imprimir s$ + " =",ABC2Nr(s$)
WaitInput
Cls
Selección aleatoria
WhileLoop 0,780,1
Imprimir Nr2ABC(&Loop),
Wend
WaitInput
Cls
WhileLoop 00,480,1
Imprimir Nr2ABC(&Loop + Rnd(345676)),
Wend
WaitInput
Hier es todavía una kleines Programa, en el uno una bischen herumexperimentieren kann:
$H windows.ph
Def DelLast(2) Mid$(@$(1),1,(Len(@$(1)) - @&(2)))
'hier puede ser schön nachlesen, como así una Umrechnung funktioniert:
'https://www.arndt-bruenner.de/mathe/scripts/Zahlensysteme.htm
Proc Nr2ABC
Parámetros Zahl!
Declarar Valor$,Rest%
Mientras que Zahl! > 0
Rest% = Zahl! Mod 26
Zahl! = Zahl! \ 26
If Rest% = 0
Zahl! = Zahl! -1
Rest% = 26
EndIf
Case Rest% > 0:Valor$ = Chr$(Rest% + 64) + Valor$
Wend
Volver Valor$
ENDPROC
Proc ABC2Nr
Parámetros Texto$
Declarar Zahl!,Summe!,B$
WhileLoop Len(Texto$),1,-1
B$ = Substr$(Texto$,&Loop)
Zahl! = Chr$(B$) * 26^(&Loop-1)
Summe! = Summe! + Zahl!
Wend
Volver Summe!
ENDPROC
SubProc Crear.TextR
Volver @Control("STATIC",@$(2),$50000002,@%(3),@%(4), \
@%(5),@%(6),@%(1),101, %hInstance)
ENDPROC
Proc Text_setzen
Parámetros cb&,txt&,txt1&
Declarar Texto$,Ergebnis!
Texto$ = GetText $(txt&)
SetText txt1&,Str$((GetCurSel(cb&)) * Val(Texto$))
Claro Texto$
WhileLoop 0,Stellen%-1
Ergebnis! = Val(GetText $(txt1&[&Loop])) + Ergebnis!
Texto$ = Texto$ + GetText $(cb&[&Loop])
Wend
SetText txt_Ergebnis&,Str$(Ergebnis!)
SetText txt_Alphabet&,Texto$
SetText txt_Nr2ABC&,Nr2ABC(Ergebnis!)
ENDPROC
Proc Button_Aktion
Parámetros btn&
If GetText $(btn&) = "Null setzen"
SendMessage(cb&[focus%],$014E,0,0)
Text_setzen(cb&[focus%],txt&[focus%],txt1&[focus%])
SetText btn&,"Zufall"
Más
SendMessage(cb&[focus%],$014E,Rnd(26),0)
Text_setzen(cb&[focus%],txt&[focus%],txt1&[focus%])
SetText btn&,"Null setzen"
EndIf
ENDPROC
Proc Alle_Null
Parámetros btn&
If GetText $(btn&) = "alle Null setzen"
WhileLoop 0,Stellen%-1
SendMessage(cb&[&Loop],$014E,0,0)
Text_setzen(cb&[&Loop],txt&[&Loop],txt1&[&Loop])
SetText btn&[&Loop],"Zufall"
Wend
SetText btn&,"alle Zufall"
Más
WhileLoop 0,Stellen%-1
SendMessage(cb&[&Loop],$014E,Rnd(26),0)
Text_setzen(cb&[&Loop],txt&[&Loop],txt1&[&Loop])
SetText btn&[&Loop],"Null setzen"
Wend
SetText btn&,"alle Null setzen"
EndIf
ENDPROC
Declarar Stellen%
Stellen% = 10
Declarar cb&[Stellen%],txt&[Stellen%],txt1&[Stellen%],A$,x%,b%,focushdl&,focus%,Ergebnis&
Declarar btn&[Stellen% + 1]
b% = 118
x% = 120
Ventana de Estilo 8 | 24 | 512
Ventana Stellen% * (b% + 24),300
SetDialogFont ~GetStockObject($11)
WhileLoop 26
a$ = a$ + Chr$(64 + &bucle) + "|"
Wend
a$ = " |" + DelLast(a$,1)
MoveStrToList(a$,"|")
WhileLoop 0,Stellen%-1
cb&[&Loop] = Crear("ChoiceBox",%hwnd,0,5 + &Loop * x%,40,b%,160)
Crear("Tooltip",%hwnd,cb&[&Loop],"26^" + Str$(Stellen%-1 - &Loop))
MoveListToHandle(cb&[&Loop])
SendMessage(cb&[&Loop],$014E,0,0)
txt&[&Loop] = Crear("TextR",%hwnd,"",5 + &Loop * x%,10,b%,20)
txt1&[&Loop] = Crear("TextR",%hwnd,"",5 + &Loop * x%,80,b%,20)
btn&[&Loop] = Crear("Button",%hwnd,"Zufall",5 + &Loop * x%,110,b%,20)
Case &Loop = Stellen% - 1:btn&[&Loop + 1] = Crear("Button",%hwnd,"Zufall",5 + (&Loop + 1) * x%,110,b%,20)
Wend
Var txt_Alphabet& = Crear("TextR",%hwnd,"",5 + Stellen% * x%,40,b% + Stellen%,20)
Var txt_Ergebnis& = Crear("TextR",%hwnd,"",5 + Stellen% * x%,80,b%,20)
Var txt_Nr2ABC& = Crear("TextR",%hwnd,"",5 + Stellen% * x%,140,b%,20)
Conjunto("Decimals",0)
WhileLoop 0,Stellen%-1
SetText txt&[Stellen%-1 - &Loop],Str$(26^&Loop)
Wend
Selección aleatoria
Mientras que 1
WaitInput
focushdl& = %getfocus
WhileLoop 0,Stellen%-1
Case focushdl& = cb&[&Loop]:focus% = &Loop
If focushdl& = btn&[&Loop]
focus% = &Loop
EndIf
Wend
If %key = 2
Romper
ElseIf GetFocus(cb&[focus%])
Case GetCurSel(cb&[focus%]) > -1:Text_setzen(cb&[focus%],txt&[focus%],txt1&[focus%])
ElseIf Clicked(btn&[focus%])
Button_Aktion(btn&[focus%])
ElseIf Clicked(btn&[Stellen%])
Alle_Null(btn&[Stellen%])
ElseIf %mousepressed = 2
CreateMenu
AppendMenu 100,"Summe kopieren"
AppendMenu 101,"Buchstaben kopieren"
TrackMenu %mousex,%mousey
If MenuItem(100)
ClearClip
PutClip GetText $(txt_Ergebnis&)
ElseIf MenuItem(101)
ClearClip
PutClip GetText $(txt_Alphabet&)
EndIf
EndIf
Wend
Hier es ni Auflistung:
Proc Nr2ABC
Parámetros Zahl!
Declarar Valor$,Rest%
Mientras que Zahl! > 0
Rest% = Zahl! Mod 26
Zahl! = Zahl! \ 26
If Rest% = 0
Zahl! = Zahl! -1
Rest% = 26
EndIf
Case Rest% > 0:Valor$ = Chr$(Rest% + 64) + Valor$
Wend
Volver Valor$
ENDPROC
Cls
ShowMax
Declarar Stellen%[6],Valor$[6],n%,a$,b$,OrdNr&,Encabezamiento$,s$
Claro Stellen%[]
OrdNr& = 1
Var b% = %maxx \ 27 -1
WhileLoop 26
s$ = s$ + Chr$(64 + &bucle) + ";1;" + Str$(b%) + ";"
Wend
s$ = ";0;" + Str$(b%) + ";" + s$
Var l& = Crear("GridBox",%hwnd,s$,0,2,2,Width(%hwnd)-4,Height(%hwnd)-4)
WhileLoop 26^2
WhileLoop 26
B$ = B$ + Nr2ABC(OrdNr&) + "|"
Inc OrdNr&
Wend
AddStrings(l&,Str$(OrdNr&-26) + "|" + b$)
Claro b$
Título de la ventana Str$(OrdNr&) + " Geduld - lo va a 26^3 (" + Str$(Int(26^3)) + ")"
Wend
Título de la ventana Str$(OrdNr&) + " Geduld - lo va a 26^3 (" + Str$(Int(26^3)) + ") fertig!"
Mientras que 1
WaitInput
Wend
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 23.10.2011 ▲ |
| |  |
| | | | | - Página 3 - |
|  Nico Madysa | Glaube Yo gern. Yo frage mich auch ehrlich dijo, qué du dir en If-Abfrage pensamiento hast. 
Noch veces: Usted hast zwei getrennte Dinge a tun: Zuerst korrigierst du deine Zahl después de oben, entonces benutzt du esta Zahl en Jörgs Algorithmus para Basenwechsel. Also así qué como:
"FÜR N=0 BIS (Stellenzahl(zahl,27)-2) TUE X" heißt: Usted lässt N de 0 a a un número laufen y para cada Valor führst du X de. Exactamente el macht una Whileloop-Bucle:
In unserem Falle also:
Jetzt musst du praktisch sólo todavía el código en el richtigen Reihenfolge zusammenpappen. Yo hoffe, el schaffst du sin Ayuda.  |
| | | | |
| |  Julian Schmidt | Verflixt a sólo tener Yo auch una Bucle pensamiento sólo entonces ha el Concepto uno IF-Condición doch überwiegt.  |
| | | | |
| |  Julian Schmidt | Lo voluntad siempre no tan bastante. Yo vermute el "-" no es igual 0, pero igual 1 es. Weiterhin entonces A=2, B=3, C=4
Def $Werte "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Def $Alphabet "-ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Proc Stellenzahl
Parámetros zahl%,basis%
Volver int(lg(zahl%) / lg(basis%))+1
ENDPROC
proc NumberToLetter
Parámetros Zahl&
declarar letters$
whileloop 0,(Stellenzahl(Zahl&,27)-2)
Zahl& = Zahl& + (27 ^ &bucle)
EndWhile
letters$=Wechsle_Basis(Zahl&,27)
Volver letters$
ENDPROC
Proc Wechsle_Basis
Parámetros Zahl&,Base%
Declarar Ergebnis&,Rest&,Valor$
Repeat
Ergebnis& = Zahl& \ Base%
Rest& = Zahl& Mod Base%
If Base% = 27
Valor$ = Substr$($Alphabet,Rest&+1) + Valor$
Más
Valor$ = Substr$($Werte,Rest&+1) + Valor$
EndIf
Zahl& = Ergebnis&
Case Rest& = 0:Rest& = Ergebnis&
Until Rest& = 0
Case Left$(Valor$,1)="0":Valor$=Del$(Valor$,1,1)
Case Valor$ = "":Valor$ = "0"
Case Left$(Valor$,1)="A":Valor$=Del$(Valor$,1,1)
Case Valor$ = "":Valor$ = "A"
Valor$=Del$(Valor$,1,1)
Volver Valor$
ENDPROC
WhileLoop 1000
AddStrings Str$(&bucle) + " = " + NumberToLetter(&bucle)
Endwhile
ListBox$("Ergebnis",2)
|
| | | | |
| |  Nico Madysa | Hm, si "-"=0 wäre, entonces debería él sí bastante oben auch en "-" anfangen y no en "A".
Yo vermute más, dass en media Ausführungen a Corrección una kleiner Denkfehler drin war ... Yo melde mich, si yo ihn gefunden habe.  |
| | | | |
| |  Jörg Sellmeyer | Yo verstehe, ehrlich dijo, el problema no. Meinen Code oben Usted necesita doch sólo en el "-" ergänzen y el 26 por 27 ergänzen. Dann el überflüssigen führenden "-" wegmachen:
Def $Werte "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Def $Alphabet "-ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Proc Umwandeln
Parámetros Zahl&,Base%
Declarar Ergebnis&,Rest&,Valor$
Repeat
Ergebnis& = Zahl& \ Base%
Rest& = Zahl& Mod Base%
If Base% = 27
Valor$ = Substr$($Alphabet,Rest&+1) + Valor$
Más
Valor$ = Substr$($Werte,Rest&+1) + Valor$
EndIf
Zahl& = Ergebnis&
Case Rest& = 0:Rest& = Ergebnis&
Until Rest& = 0
Case Left$(Valor$,1)="0":Valor$=Del$(Valor$,1,1)
Case Valor$ = "":Valor$ = "0"
Case Left$(Valor$,1)="-":Valor$=Del$(Valor$,1,1)
Case Valor$ = "":Valor$ = "A"
Volver Valor$
ENDPROC
Cls
ShowMax
Declarar l&,d$,z%,s$
WhileLoop 0,26
s$ = s$ + Chr$(64 + &Loop) + " = " + Str$(&Loop) + ";1;70;"
Wend
s$ = "-" + Del$(s$,1,1)
l& = Crear("GridBox",%hwnd,s$,0,2,2,Width(%hwnd)-4,Height(%hwnd)-4)
AddStrings(l&,MkStr$("|",27))
WhileLoop 0,2900'0
s$ = Umwandeln(&Loop,27)
SetText l&,z%,(&Loop Mod 27),s$
'hier auch con zugehöriger Zahl:
'SetText l&,z%,(&Loop Mod 27),Str$(&Loop ) + " = " + s$
Caso negativo (&Loop + 1) Mod 27
Inc z%
AddStrings(l&,"|")
EndIf
Wend
Mientras que 1
WaitInput
Wend
Selección aleatoria
Declarar Input&
Aber tal vez verstehe Yo De todos modos todavía no, qué Usted eigentlich erreichen willst... |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 19.10.2011 ▲ |
| |
| | | | - Página 4 - |
| |  Nico Madysa | Ehm ... Denk dir en deiner Gridbox praktisch el linke Spalte weg y el Línea, en el una Bindestrich en el Mitte es -- entonces es como genau el, qué Julian haben voluntad.
En Word, Excel, Open Ofice, etc. puede ser Nummerierungen en lugar de con Pagar sí con Buchstaben durchführen. 1, 2, 3, 4, 5, ... --> A, B, C, D, E, ... Und esta Buchstabierung setzt se de 24 sólo así fort: X, Y, Z, AA, AB, AC, AD, ... ZY, ZZ, AAA, AAB, ...
Und Julian voluntad praktisch una Función, el cada Zahl el entsprechende Buchstabenfolge zuordnet y una, el el Gegenteil macht.
Mir el Kode anzusehen, Yo desafortunadamente todavía no geschafft. Gerade algo mehr a tun, como Yo antes unos pocos Stunden todavía esperado hätte.  |
| | | | |
| |  Julian Schmidt | Nico Madysa (19.10.11)
Hm, si "-"=0 wäre, entonces debería él sí bastante oben auch en "-" anfangen y no en "A".
Ist el el no así?
Lo voluntad siempre todavía no así bastante.
Yo vermute el "-" no igual 0, pero igual 1 es.
Weiterhin entonces A=2, B=3, C=4
[CODE]Def $Werte "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Def $Alphabet "-ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Proc Stellenzahl
Parámetros zahl%,basis%
Volver int(lg(zahl%) / lg(basis%))+1
ENDPROC
proc NumberToLetter
Parámetros Zahl&
declarar letters$
whileloop 0,(Stellenzahl(Zahl&,27)-2)
Zahl& = Zahl& + (27 ^ &bucle)
EndWhile
letters$=Wechsle_Basis(Zahl&,27)
Volver letters$
ENDPROC
Proc Wechsle_Basis
Parámetros Zahl&,Base%
Declarar Ergebnis&,Rest&,Valor$
Repeat
Ergebnis& = Zahl& \ Base%
Rest& = Zahl& Mod Base%
If Base% = 27
Valor$ = Substr$($Alphabet,Rest&+1) + Valor$
Más
Valor$ = Substr$($Werte,Rest&+1) + Valor$
EndIf
Zahl& = Ergebnis&
Case Rest& = 0:Rest& = Ergebnis&
Until Rest& = 0
Case Left$(Valor$,1)="0":Valor$=Del$(Valor$,1,1)
Case Valor$ = "":Valor$ = "0"
Case Left$(Valor$,1)="A":Valor$=Del$(Valor$,1,1)
Case Valor$ = "":Valor$ = "A"
Volver Valor$
ENDPROC
WhileLoop 1000
AddStrings Str$(&bucle) + " = " + NumberToLetter(&bucle)
Endwhile
ListBox$("Ergebnis",2)
Yo sehe como zumindest "-" Signo al Anfang. Hab beim letzten Posting evtl. simplemente vergessen una Codezeile a lösche. Hatte el erste Signo abgeschnitten el Übersichtlichkeit halber |
| | | | |
| |  Jörg Sellmeyer | Lo ha me no Ruhe gelassen y yo tener todavía weitergetüftelt. Jetzt tener ich's fuera y es letztlich unkomplizierter como anfangs esperado.
'y umgekehrt
'Jörg Selllmeyer 2011
'a freien Verwendung
'hier bekommt uno muy bien erklärt, como el Umrechnen de Pagar en un otro Base funktioniert:
'https://www.arndt-bruenner.de/mathe/scripts/Zahlensysteme.htm
'El Schwierigkeit hierbei, Es el fehlende Null. Alle Nullstellen necesario abgefangen voluntad, el
'aktuelle Punto en eins verringert y el folgende Punto ebenfalls en eins verringert voluntad.
'Der Valor A000 se entonces also sin Nullen a YYZ. C000 se a BYYZ
Proc Nr2ABC
Parámetros Zahl!
Declarar Valor$,Rest%
Mientras que Zahl! > 0
Rest% = Zahl! Mod 26
Zahl! = Zahl! \ 26
If Rest% = 0
'hier voluntad el Nullstellen abgefangen y umgewandelt
Zahl! = Zahl! -1
Rest% = 26
EndIf
Case Rest% > 0:Valor$ = Chr$(Rest% + 64) + Valor$
Wend
Volver Valor$
ENDPROC
Proc ABC2Nr
Parámetros Texto$
Declarar Zahl!,Summe!,B$
Texto$ = Upper$(Texto$)
WhileLoop Len(Texto$),1,-1
B$ = Substr$(Texto$,-&Loop)
Zahl! = (Ord(B$)-64) * 26^(&Loop-1)
Summe! = Summe! + Zahl!
Wend
Volver Int(Summe!)
ENDPROC
Cls
Título de la ventana "Zahlen en Buchstaben umwandeln y umgekehrt"
Imprimir "LQSVOFKGQM =", ABC2Nr("LQSVOFKGQM")
Imprimir "AAAAAA =", ABC2Nr("AAAAAA")
Imprimir "ABCDEFGH =", ABC2Nr("ABCDEFGH")
Imprimir
Imprimir "XPROFAN macht Spass =", ABC2Nr("XPROFAN"),ABC2Nr("macht"),ABC2Nr("Spass")
Imprimir
Declarar s$
Selección aleatoria
WhileLoop 10
s$ = Chr$(Rnd(26) + 65) + s$
Wend
Imprimir s$ + " =",ABC2Nr(s$)
WaitInput
Cls
Selección aleatoria
WhileLoop 0,780,1
Imprimir Nr2ABC(&Loop),
Wend
WaitInput
Cls
WhileLoop 00,480,1
Imprimir Nr2ABC(&Loop + Rnd(345676)),
Wend
WaitInput
Hier es todavía una kleines Programa, en el uno una bischen herumexperimentieren kann:
$H windows.ph
Def DelLast(2) Mid$(@$(1),1,(Len(@$(1)) - @&(2)))
'hier puede ser schön nachlesen, como así una Umrechnung funktioniert:
'https://www.arndt-bruenner.de/mathe/scripts/Zahlensysteme.htm
Proc Nr2ABC
Parámetros Zahl!
Declarar Valor$,Rest%
Mientras que Zahl! > 0
Rest% = Zahl! Mod 26
Zahl! = Zahl! \ 26
If Rest% = 0
Zahl! = Zahl! -1
Rest% = 26
EndIf
Case Rest% > 0:Valor$ = Chr$(Rest% + 64) + Valor$
Wend
Volver Valor$
ENDPROC
Proc ABC2Nr
Parámetros Texto$
Declarar Zahl!,Summe!,B$
WhileLoop Len(Texto$),1,-1
B$ = Substr$(Texto$,&Loop)
Zahl! = Chr$(B$) * 26^(&Loop-1)
Summe! = Summe! + Zahl!
Wend
Volver Summe!
ENDPROC
SubProc Crear.TextR
Volver @Control("STATIC",@$(2),$50000002,@%(3),@%(4), \
@%(5),@%(6),@%(1),101, %hInstance)
ENDPROC
Proc Text_setzen
Parámetros cb&,txt&,txt1&
Declarar Texto$,Ergebnis!
Texto$ = GetText $(txt&)
SetText txt1&,Str$((GetCurSel(cb&)) * Val(Texto$))
Claro Texto$
WhileLoop 0,Stellen%-1
Ergebnis! = Val(GetText $(txt1&[&Loop])) + Ergebnis!
Texto$ = Texto$ + GetText $(cb&[&Loop])
Wend
SetText txt_Ergebnis&,Str$(Ergebnis!)
SetText txt_Alphabet&,Texto$
SetText txt_Nr2ABC&,Nr2ABC(Ergebnis!)
ENDPROC
Proc Button_Aktion
Parámetros btn&
If GetText $(btn&) = "Null setzen"
SendMessage(cb&[focus%],$014E,0,0)
Text_setzen(cb&[focus%],txt&[focus%],txt1&[focus%])
SetText btn&,"Zufall"
Más
SendMessage(cb&[focus%],$014E,Rnd(26),0)
Text_setzen(cb&[focus%],txt&[focus%],txt1&[focus%])
SetText btn&,"Null setzen"
EndIf
ENDPROC
Proc Alle_Null
Parámetros btn&
If GetText $(btn&) = "alle Null setzen"
WhileLoop 0,Stellen%-1
SendMessage(cb&[&Loop],$014E,0,0)
Text_setzen(cb&[&Loop],txt&[&Loop],txt1&[&Loop])
SetText btn&[&Loop],"Zufall"
Wend
SetText btn&,"alle Zufall"
Más
WhileLoop 0,Stellen%-1
SendMessage(cb&[&Loop],$014E,Rnd(26),0)
Text_setzen(cb&[&Loop],txt&[&Loop],txt1&[&Loop])
SetText btn&[&Loop],"Null setzen"
Wend
SetText btn&,"alle Null setzen"
EndIf
ENDPROC
Declarar Stellen%
Stellen% = 10
Declarar cb&[Stellen%],txt&[Stellen%],txt1&[Stellen%],A$,x%,b%,focushdl&,focus%,Ergebnis&
Declarar btn&[Stellen% + 1]
b% = 118
x% = 120
Ventana de Estilo 8 | 24 | 512
Ventana Stellen% * (b% + 24),300
SetDialogFont ~GetStockObject($11)
WhileLoop 26
a$ = a$ + Chr$(64 + &bucle) + "|"
Wend
a$ = " |" + DelLast(a$,1)
MoveStrToList(a$,"|")
WhileLoop 0,Stellen%-1
cb&[&Loop] = Crear("ChoiceBox",%hwnd,0,5 + &Loop * x%,40,b%,160)
Crear("Tooltip",%hwnd,cb&[&Loop],"26^" + Str$(Stellen%-1 - &Loop))
MoveListToHandle(cb&[&Loop])
SendMessage(cb&[&Loop],$014E,0,0)
txt&[&Loop] = Crear("TextR",%hwnd,"",5 + &Loop * x%,10,b%,20)
txt1&[&Loop] = Crear("TextR",%hwnd,"",5 + &Loop * x%,80,b%,20)
btn&[&Loop] = Crear("Button",%hwnd,"Zufall",5 + &Loop * x%,110,b%,20)
Case &Loop = Stellen% - 1:btn&[&Loop + 1] = Crear("Button",%hwnd,"Zufall",5 + (&Loop + 1) * x%,110,b%,20)
Wend
Var txt_Alphabet& = Crear("TextR",%hwnd,"",5 + Stellen% * x%,40,b% + Stellen%,20)
Var txt_Ergebnis& = Crear("TextR",%hwnd,"",5 + Stellen% * x%,80,b%,20)
Var txt_Nr2ABC& = Crear("TextR",%hwnd,"",5 + Stellen% * x%,140,b%,20)
Conjunto("Decimals",0)
WhileLoop 0,Stellen%-1
SetText txt&[Stellen%-1 - &Loop],Str$(26^&Loop)
Wend
Selección aleatoria
Mientras que 1
WaitInput
focushdl& = %getfocus
WhileLoop 0,Stellen%-1
Case focushdl& = cb&[&Loop]:focus% = &Loop
If focushdl& = btn&[&Loop]
focus% = &Loop
EndIf
Wend
If %key = 2
Romper
ElseIf GetFocus(cb&[focus%])
Case GetCurSel(cb&[focus%]) > -1:Text_setzen(cb&[focus%],txt&[focus%],txt1&[focus%])
ElseIf Clicked(btn&[focus%])
Button_Aktion(btn&[focus%])
ElseIf Clicked(btn&[Stellen%])
Alle_Null(btn&[Stellen%])
ElseIf %mousepressed = 2
CreateMenu
AppendMenu 100,"Summe kopieren"
AppendMenu 101,"Buchstaben kopieren"
TrackMenu %mousex,%mousey
If MenuItem(100)
ClearClip
PutClip GetText $(txt_Ergebnis&)
ElseIf MenuItem(101)
ClearClip
PutClip GetText $(txt_Alphabet&)
EndIf
EndIf
Wend
Hier es ni Auflistung:
Proc Nr2ABC
Parámetros Zahl!
Declarar Valor$,Rest%
Mientras que Zahl! > 0
Rest% = Zahl! Mod 26
Zahl! = Zahl! \ 26
If Rest% = 0
Zahl! = Zahl! -1
Rest% = 26
EndIf
Case Rest% > 0:Valor$ = Chr$(Rest% + 64) + Valor$
Wend
Volver Valor$
ENDPROC
Cls
ShowMax
Declarar Stellen%[6],Valor$[6],n%,a$,b$,OrdNr&,Encabezamiento$,s$
Claro Stellen%[]
OrdNr& = 1
Var b% = %maxx \ 27 -1
WhileLoop 26
s$ = s$ + Chr$(64 + &bucle) + ";1;" + Str$(b%) + ";"
Wend
s$ = ";0;" + Str$(b%) + ";" + s$
Var l& = Crear("GridBox",%hwnd,s$,0,2,2,Width(%hwnd)-4,Height(%hwnd)-4)
WhileLoop 26^2
WhileLoop 26
B$ = B$ + Nr2ABC(OrdNr&) + "|"
Inc OrdNr&
Wend
AddStrings(l&,Str$(OrdNr&-26) + "|" + b$)
Claro b$
Título de la ventana Str$(OrdNr&) + " Geduld - lo va a 26^3 (" + Str$(Int(26^3)) + ")"
Wend
Título de la ventana Str$(OrdNr&) + " Geduld - lo va a 26^3 (" + Str$(Int(26^3)) + ") fertig!"
Mientras que 1
WaitInput
Wend
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 23.10.2011 ▲ |
| |
| |  Julian Schmidt | Cool lo funktioniert, y incluso super rápidamente  Gracias Jörg  |
| | | | |
| |  | Pheeeerfekt!  |
| | | | |
| |  Julian Schmidt |  Das Thema es sí immernoch aktiv. Muss Yo veces schließen  |
| | | | |
| |  | Also algo como!  |
| | | | |
|
RespuestaTema opciones | 29.978 Views |
ThemeninformationenDieses Thema ha 4 subscriber: |