| |
|
|
 Jörg Sellmeyer | I wanted to time mathematically each Zahlenstellen of/ one given number herausbekommen. the [...] was my first Ansatz.
The second was then already erfolgreicher:
SubProc Get.1
Parameters Zahl&
Return (Zahl& Mod 10)
ENDPROC
SubProc Get.10
Parameters Zahl&
Return ((Zahl& Mod 100) - (Zahl& Mod 10)) \ 10
ENDPROC
SubProc Get.100
Parameters Zahl&
Return ((Zahl& Mod 1000) - (Zahl& Mod 100)) \ 100
ENDPROC
SubProc Get.1000
Parameters Zahl&
Return ((Zahl& Mod 10000) - (Zahl& Mod 1000)) \ 1000
ENDPROC
Print "34567 many Einzelfunktionen"
Print Get("1",34567)
Print Get("10",34567)
Print Get("100",34567)
Print Get("1000",34567)
Print
WaitInput
SubProc Get.number
' index indicate as 1 or 2, 3 etc.
Parameters Ind%,Zahl&
Declare tmp1&,tmp2&,tmp3&
tmp1& = 10^Ind%
tmp2& = 10 ^(Ind%-1)
Return ((Zahl& Mod tmp1&) - (Zahl& Mod tmp2&)) \ tmp2&
ENDPROC
'the can ad infinitum weiteführen or a felexible procedure from it make
'The number hinten, so one in a Headerdatei z. B tenner( = Get("Zahl",2,; define can
Print "34567 Flexible Funktion"
WhileLoop 4
Print Get("Zahl",&Loop,34567),
Wend
Print
WaitInput
'or integrally brachial as Stringauswertung
'has whom benefit, that one discretionary large numbers transfer can
Proc ZahlenStelle
Parameters number$,index%
Return Mid$(number$,-index%,1)
ENDPROC
Print
Print "144545678844356 Auswertung as String"
WhileLoop 13
Print ZahlenStelle(144545678844356,&Loop),
Wend
Print
Print "Auch andersherum"
WhileLoop 13
Print ZahlenStelle(144545678844356,-&Loop),
Wend
WaitInput
|
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 05/24/18 ▲ |
|
|
|
|
 jacdelad | tmp1& can itself even save and tmp3& becomes eh not using:
|
|
|
| |
|
|