![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-30 11:29 |
47,813 topics / 349,918 posts / today 0 new / 48,279 members |
| DOS批处理 & 脚本技术(批处理室) » What does "goto :eof" mean? |
| Printable Version 2,508 / 15 |
| Floor1 kidzgy | Posted 2007-08-04 20:53 |
| 中级用户 Posts 129 Credits 262 | |
|
What does "goto :eof" mean?
|
|
| Floor2 slore | Posted 2007-08-04 20:56 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
end of file?
To the end... That is, exit |
|
| Floor3 zw750516 | Posted 2007-08-04 21:30 |
| 新手上路 Posts 7 Credits 16 | |
|
In batch processing, `goto :s` means to jump to the line marked with `:s`, and specifically it depends on the commands to be executed next.
|
|
| Floor4 wudixin96 | Posted 2007-08-04 21:43 |
| 银牌会员 Posts 931 Credits 1,928 | |
|
goto :eof is slightly different from ordinary jumps.
In goto :eof, the : must be added, while in ordinary jumps, the : sign can be omitted. goto :eof does not need a label on a certain line, while ordinary jumps must have a label. For example: Upstairs, a label must be set on a certain line. Such as :s. [ Last edited by wudixin96 on 2007-8-4 at 09:48 PM ] |
|
| Floor5 zw750516 | Posted 2007-08-04 22:24 |
| 新手上路 Posts 7 Credits 16 | |
|
Hehe, learned something new again, thanks to the person above!
|
|
| Floor6 kidzgy | Posted 2007-08-05 07:30 |
| 中级用户 Posts 129 Credits 262 | |
|
What does `goto :eof` mean? If you want to exit, why not just use `exit`?
|
|
| Floor7 gmsx007 | Posted 2007-08-05 14:13 |
| 初级用户 Posts 36 Credits 75 | |
|
I don't understand this very much. Can you be more detailed?
|
|
| Floor8 knoppix7 | Posted 2007-08-06 10:02 |
| 银牌会员 Posts 634 Credits 1,287 From cmd.exe | |
|
Where to come from and where to go. Personal understanding.
For example: call :XXXXXX 1234 :XXXXXX XXX goto :eof After calling, it directly returns to the place of call :XXXXXX and continues to execute downward. (I haven't used it.. so..) |
|
| Floor9 6622186 | Posted 2007-08-06 23:51 |
| 高级用户 Posts 411 Credits 894 | |
Originally posted by kidzgy at 2007-8-5 07:30 AM: You're thinking too simply. goto :eof isn't about exiting. |
|
| Floor10 lbccyxs | Posted 2007-08-07 05:10 |
| 初级用户 Posts 27 Credits 54 | |
|
Can you give an example? Just asking because I don't understand
|
|
| Floor11 kidzgy | Posted 2007-08-07 10:26 |
| 中级用户 Posts 129 Credits 262 | |
|
Then what does `goto :eof` exactly mean?
|
|
| Floor12 sdp910 | Posted 2007-08-07 21:53 |
| 初级用户 Posts 40 Credits 89 | |
|
goto eof is used in batch script writing, and exit is a command directly in the DOS interface...
|
|
| Floor13 shifengl | Posted 2009-05-25 04:15 |
| 新手上路 Posts 4 Credits 14 | |
| Floor14 dnntgmfd | Posted 2009-05-25 04:47 |
| 初级用户 Posts 52 Credits 85 From 湘乡 | |
|
The above one:
@set c= I don't know then I feel more, I know then I feel less, the more I know the more, then I feel less and less. --- Knowing more and less. @for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul It's so amazing, can you explain it? |
|
| Floor15 Hanyeguxing | Posted 2009-05-25 12:21 |
| 银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂 | |
|
In general batch processing, there is not an obvious difference between goto :eof and exit, but when calling multiple labels, the difference can be seen. As follows:
@echo off for /l %%i in (1,1,3) do call :%%i pause exit :1 echo 1 pause goto :eof :2 echo 2 pause goto :eof :3 echo 3 pause goto :eof :The last goto :eof can be omitted |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |