Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
sklub
- Posts: 9
- Joined: 13 Jan 2017 12:56
#1
Post
by sklub » 13 Jan 2017 13:03
Last edited by
Squashman on 13 Jan 2017 13:17, edited 1 time in total.
Reason: MOD EDIT: Please use code tags.
-
Squashman
- Expert
- Posts: 4486
- Joined: 23 Dec 2011 13:59
#2
Post
by Squashman » 13 Jan 2017 13:18
sklub wrote:does anyone use this ?
Why would anyone use this code?
-
sklub
- Posts: 9
- Joined: 13 Jan 2017 12:56
#3
Post
by sklub » 13 Jan 2017 13:32
not the script itself thats garbage for the garbage can.
but im looking for usefull fuction to implement a goto %loop% function...
does any one know any good use for this,because so far ive only been replacing it with real loops.
-
Cornbeetle
- Posts: 31
- Joined: 23 Nov 2015 09:34
#4
Post
by Cornbeetle » 13 Jan 2017 13:48
Not sure why you would need to do this.
Code: Select all
set label=:top
:top
set /a num+=1
echo %num%
goto %label%
-
Aacini
- Expert
- Posts: 1914
- Joined: 06 Dec 2011 22:15
- Location: México City, México
-
Contact:
#6
Post
by Aacini » 13 Jan 2017 15:15
The simplest example of a similar code is this:
Code: Select all
choice /C ABC /M "Enter desired option: "
goto option-%errorlevel%
:option-1 A
:option-2 B
etc...
Antonio
-
Aspidiske
- Posts: 7
- Joined: 30 Oct 2016 09:48
#7
Post
by Aspidiske » 14 Jan 2017 08:25
goto as variable already used as following:
This allows you to invert the sequence between programming sets
Code: Select all
@echo off
set exitprogram1=program3
set exitprogram3=program2
set exitprogram2=completed
goto program1
rem -------------------------------1
:program1
echo.1
goto %exitprogram1%
rem -------------------------------2
:program2
echo.2
goto %exitprogram2%
rem -------------------------------3
:program3
echo.3
goto %exitprogram3%
:completed
pause
-
sklub
- Posts: 9
- Joined: 13 Jan 2017 12:56
#8
Post
by sklub » 15 Jan 2017 15:52
Well im just messing around with scripts Learning in the process...Thanks for the posts