01-20-2026, 10:29 PM
(This post was last modified: 01-20-2026, 10:30 PM by Kernelpanic.)
Regarding converting string segments to numbers: Strings in numbers
I've looked at it again, and it only really gets complicated when dealing with two-digit numbers. I also tried passing the data to a procedure – the data transfer isn't the problem, only the result.
The program works as long as you don't go beyond the single-digit range. Maybe this will give someone some ideas.
I've looked at it again, and it only really gets complicated when dealing with two-digit numbers. I also tried passing the data to a procedure – the data transfer isn't the problem, only the result.
The program works as long as you don't go beyond the single-digit range. Maybe this will give someone some ideas.
Code: (Select All)
'ABCDEFGHIJ und 1234567890 tauschen die Plaetze: BCD und 234 -- 26. Dez. 2025
'Erweitert flexible Eingaben - 17. Jan. 2026
Option _Explicit
Dim As String strBuchstaben, strZahlen, strTeilbuchstaben, strTeilzahlen
Dim As String strNeuBuchstaben, strNeuZahlen
Dim As Integer position, bereich
strBuchstaben = "ABCDEFGHIJ"
strZahlen = "1234567890"
Locate 2, 3
Print "Buchstaben - Zahlentausch"
Locate 3, 3
Print "========================="
Locate 5, 3
Print strBuchstaben
Locate 6, 3
Print strZahlen
NeueEingabe:
'Position und Bereich des Austauschs flexibel
Locate 8, 3
Input "Position : ", position
Locate 9, 3
Input "Bereich(max 3): ", bereich
'Eingabefehler abfangen
If position < 1 Or position > 10 Then
Cls
Beep: Print
Print "Position zwischen 1 bis 10"
Sleep 2
GoTo NeueEingabe
End If
'Teilstring von beiden extrahieren. Von Position 2 an,
'3 Positionen. Also: BCD + 234
strTeilbuchstaben = Mid$(strBuchstaben, position, bereich)
Locate 11, 3
Print strTeilbuchstaben
strTeilzahlen = Mid$(strZahlen, position, bereich)
Locate 12, 3
Print strTeilzahlen
'In Buchstaben Zahlen einfuegen. Angabe der Position reicht!
strNeuBuchstaben = Left$(strBuchstaben, position) + strTeilzahlen + Mid$(strBuchstaben, 5)
Locate CsrLin + 2, 3
Print strNeuBuchstaben
'Umgekehrt: Buchstaben in Zahlen
strNeuZahlen = Left$(strZahlen, position) + strTeilbuchstaben + Mid$(strZahlen, 5)
Locate CsrLin + 1, 3
Print strNeuZahlen
End

