home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk23
/
dir05
/
f000680.re_
/
f000680.re
Wrap
Text File
|
1996-04-02
|
2KB
|
44 lines
' Basic program to show how to pass command line arguments to a macro.
' For example: ustn> macro cmd.bas arg1 arg2 arg3 ...
'
'--------------------------------------------------------------------
'
' Copyright (1995) Bentley Systems, Inc., All rights reserved.
'
' $Workfile: cmd.bas $
' $Revision: 6.2 $
' $Date: 11 Aug 1995 09:40:02 $
'
' "MicroStation" is a registered trademark of Bentley Systems, Inc.
'
' Limited permission is hereby granted to reproduce and modify this
' copyrighted material provided that the resulting code is used only
' in conjunction with Bentley Systems products under the terms of the
' license agreement provided therein, and that this notice is retained
' in its entirety in any such reproduction or modification.
'
'--------------------------------------------------------------------
sub main
Dim numArgs As Integer
Dim cmdArg As String
' save the command line arguments to a local variable
cmd$ = Command$
' output the command line arguments
Print "Startup line was : ("; cmd$; ")"
' save the number of arguments in a local variable
numArgs = WordCount(cmd$)
' output the number of command line arguments
Print "Number of command line arguments is : "; Str$(numArgs)
' parse the command line arguments and output each individual argument in turn
For counter% = 1 to numArgs
cmdArg = Word$ (cmd$, counter)
Print "Argument #"; Str$(counter); " is "; cmdArg
Next counter
end sub