1

I have practice script that take password from dialog box and set it to var. I want to modify it instead of taking password from dialog box it take it from command line like entering parameters to script. I have read the ref but i can't find it out.

  • This PRACTICE cheat sheet is very useful: https://www.lauterbach.com/reference_card_web.pdf – dev15 Aug 05 '22 at 06:23

1 Answers1

3

You can call a script with parameters by providing the parameters after the file name. Each parameter should be quoted:

DO my_script.cmm "<my_parameter1>" "<my_parameter2>"

The script can retrieve the parameter like below. In this example the script would fall-back to dialog or error handling if there is no password provided by command line.

PRIVATE &password
PARAMETERS &password

IF "&password"==""
(
  ;if no password provided from command line,
  ;then fall back to dialog or error handling.
)

PRINT "Password: &password"
ENDDO
Reinhard Weiss
  • 426
  • 2
  • 4