ZTree.com  | ZEN  | About...  

 Index   Back

[Q] a window created by REM #ZTSTART "" doesnt get closed by :EOF? normal?   [Q]

By: Nick Williams     West Sussex, England (forum time +5 hrs)  
Date: Sep 05,2017 at 06:38
In Response to: [Q] a window created by REM #ZTSTART "" doesnt get closed by :EOF? normal? (Ryan)

> AA=
> what is the nature of :EOF? compared to when a script run meets the end
> of lines.
> the window created by REM #ZTSTART "" in AA= doesnt get closed, when
> GOTO :EOF is carried out. i had to remove :EOF's and replace in all my
> ztreemenu.

Hi Ryan,

Some notes that might help you:-

(1) I've never used #ZTSTART, but I believe it passes on parameters and invokes the Cmd Prompt START command. The START command I have used extensively. It launches an asynchronous process which is then independent of the parent process. At a Cmd Prompt, type START /? for more details.

(2) GOTO :EOF causes execution to jump to the logical "End-Of-File". This isn't always the same as the physical "End-Of-File" (depending on whether CALL was used to invoke code execution), but in your example above, the logical EOF is the same as the physical EOF.

(3) In AA=, you have GOTO :EOF on the 3rd line. These means that the following commands, PAUSE and REM #ZTEXIT never get executed. (I think you are using REM #ZTEXIT to EXIT out of whole script, yes ?)

(4) Tip: Use EXIT /B n instead of GOTO :EOF. They do the same job, but with EXIT /B n you can specify an ERRORLEVEL to return to the calling process, e.g. EXIT /B 1 will return ERRORLEVEL 1.

Hope that helps.

Kind regards

Thread locked

Messages in this Thread

95,097 Postings in 11,989 Threads, 350 registered users, 70 users online (1 registered, 69 guests)
Index | Admin contact |   Forum Time: Sep 20, 2020 - 3:27 am EDT  |  Hits:34,147,995  (4,551 Today )
RSS Feed