Wie kann man eine Variable von 4 zufälligen zahlen (0-9) in 4 Variablen aufteilen?
Hallo erstmal an alle die sich meiner Frage widmen,
Ich würde gerne wissen wie man eine Variable von 4 Zahlen (0-9) in 4 andere Variablen aufteilt.
Z.B.:
Dann umwandeln und am Ende sollte es dann am besten so aussehen:
Ich bedanke mich im voraus schon mal für jede Antwort.
Mfg
Melmacker
Ich würde gerne wissen wie man eine Variable von 4 Zahlen (0-9) in 4 andere Variablen aufteilt.
Z.B.:
set /a Variable=0987
Variable1=0
Variable2=9
Variable3=8
Variable4=7
Ich bedanke mich im voraus schon mal für jede Antwort.
Mfg
Melmacker
Please also mark the comments that contributed to the solution of the article
Content-Key: 391726
Url: https://administrator.de/contentid/391726
Printed on: April 26, 2024 at 05:04 o'clock
2 Comments
Latest comment
@echo off
set "Variable=0987"
set /a "Variable1=%variable:~0,1%"
set /a "Variable2=%variable:~1,1%"
set /a "Variable3=%variable:~2,1%"
set /a "Variable4=%variable:~3,1%"
echo %Variable1%
echo %Variable2%
echo %Variable3%
echo %Variable4%
https://www.dostips.com/DtTipsStringManipulation.php
Gruß l.