Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Gosub in a Batch file?

1,243 views
Skip to first unread message

Joe Scuderi

unread,
Oct 28, 1998, 3:00:00 AM10/28/98
to
Does anyone know how to create a gosub strucutre in an NT batch file? Can
it be done?

Something like this:

Process job #1
Gosub Label
Process job #2
Gosub Label
End


Label:
Print a message
Return

Bradford Luten

unread,
Oct 28, 1998, 3:00:00 AM10/28/98
to
I call separate batch files for gosub..return functionality.

Glen W. Forister

unread,
Oct 28, 1998, 3:00:00 AM10/28/98
to
Check out

http://netnet.net/~swilson/kix/

KiXtart 95 is a logon script processor and/or enhanced batch language for
Windows NT and Windows 95 workstations in a Windows Networking environment.

With it, you can conditionally display information, set environment
variables, start programs, connect to network drives, read or edit the
registry, and/or change the current drive and directory using a free format
'script language'.

At 12:39 PM 10/28/98 -0800, you wrote:
>Does anyone know how to create a gosub strucutre in an NT batch file? Can
>it be done?
>
>Something like this:
>
>Process job #1
>Gosub Label
>Process job #2
>Gosub Label
>End
>
>
>Label:
>Print a message
>Return
>

Glen Forister 530-752-4337 FAX 530-752-1819 gwfor...@ucdavis.edu
Environmental Horticulture Dept., University of California, Davis, CA 95616
Home = 2319 Vernon St., Roseville, CA 95678 916-782-5718 fori...@jps.net

Mike Ransom

unread,
Oct 28, 1998, 3:00:00 AM10/28/98
to
At 12:47 PM 10/28/98 -0800, Bradford Luten wrote:
>I call separate batch files for gosub..return functionality.

Make sure you use the CALL command so you return to the calling bat file.

Otherwise, you can have the BAT file call itself recursively with different
parameters and test for parameter values (with IF "%1"=="asdfasdf" or IF
%1.==asdfasdf.) and then use GOTO commands--generally a pain. Using CALL
is generally easier.

Another option is to create a loop with a GOTO (several actually) and keep
going thru the loop with lots of value setting & testing. Again, using
CALL is easier.

att...@my-dejanews.com

unread,
Nov 20, 1998, 3:00:00 AM11/20/98
to
Batch files or .BAT files are unable to handle any form of complex flow
control and you might be better off trying a scripting alternative. Our soon
to be released batch job program called Liquid Time has embedded scripting,
advanced flow control functions and will handle your request with ease. Our
web site can be found at http://www.liquidtime.com

Regards
Trevor Attema
Code Blue Technologies


In article <3.0.5.32.1998102...@mailbox.ucdavis.edu>,


jmsc...@ucdavis.edu wrote:
> Does anyone know how to create a gosub strucutre in an NT batch file? Can
> it be done?
>
> Something like this:
>
> Process job #1
> Gosub Label
> Process job #2
> Gosub Label
> End
>
> Label:
> Print a message
> Return
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

0 new messages