0 Members and 1 Guest are viewing this topic.
- NumParsThe NumPars function allows an executable file to determine how manyparameters were passed to it by either Workbench or the CLI. Parameterspassed from the CLI are typed following the program name and separated byspaces.For example. Iet's say you have created an executable program called myprog,and run it trom the CLI in the following way:myprog filer Olle2In this case, NumPars would return the value '2' - 'file I ' and 'file2'beng the 2 parameters.Programs run from Workbench are only capable of picking up I parameterthrough the use of either the parameter file's 'Default Tool' entry in it's'.info' file, or by use of multiple selection through the 'Shift' key.If no parameters are supplied to an executable file, NumPars will return 0.During program development, the 'CLI Arguement' menu item in the 'COMPILER'menu allows you to test out CLI parameters.Par$ (Parameter)Par$ return a striny equivalent to a parameter passed to an executable filethrough either the CLI or Workbench. Please refer to NumPars for moreinformation on parameter passiny.FromCLIReturns TRUE (-1) if your program was run from the CLI, or FALSE (O) if runfrom the WorkBench.ParPath$ (parameter,type)ParPath$ returns the path that the parameter resides in, 'type' specifieshow you want the path returned:0 You want only the directory of the parameter returned. 1 You want thedirectory along with the parameter name returned.If you passed the parameter "FRED" to your program from WorkBench, and FREDresides in the directory "work:mystuff/myprograms" then ParPath$(0,0)willreturn "work:mystuff/myprograms", but ParPath$(0,1) will return"work:mystuff/myprograms/FRED".The way WB handles argument passing of directories is different to that offiles. When a directory is passed as an argument, ArgsLib gets an emptystring for the name, and the directory string holds the path to the passeddirectory AND the directory name itself.