Example 6.1. .LOCAL
/* .LOCAL example--places something in the Local environment directory */ .local~my.alarm = theAlarm /* To retrieve it */ say .local~my.alarm
/* Another .LOCAL example (Windows) */ .environment["MYAPP.PASSWORD"] = "topsecret" .environment["MYAPP.UID"] = 200 /* Create a local directory for my stuff */ .local["MYAPP.LOCAL"] = .directory~new /* Add log file for my local directory */ .myapp.local["LOG"] = .stream~new("myapp.log") say .myapp.password /* Displays "topsecret" */ say .myapp.uid /* Displays "200" */ /* Write a line to the log file */ .myapp.local~log~lineout("Logon at "time()" on "date()) /* Redirect SAY lines into a file: */ .output~destination(.stream~new("SAY_REDIRECT.TXT")) say "This goes into a file, and not onto the screen!"
/* .LOCAL example--get the individual command line arguments */ cmdargs = .local~syscargs do carg over cmdargs say carg end