Perhaps the global ARGV_z_?

http://www.jsoftware.com/jwiki/Guides/Startup?highlight=%28ARGV%29
--
David Mitchell

On 2/15/2010 3:15, Elmer Fittery wrote:
> the external command:
>
> 2!:4 fails in the following code.  Has 2!:4 been depricated?
> Is there a different foreign I could/should use?
>
> Any suggestions on how to get it to work?
>
> thanks
>
> #!/usr/local/bin/jconsole
>
> safe_getenv =. monad define
>          if. 0 -: value =. getenv y do.
>                  'undefined'
>          else.
>                  value
>          end.
> )
>
> show_info =. monad define
>          for_arg.
>             2!:4''
>          do.
>                  stdout 'ARGV: ', (>arg), LF
>          end.
>
>          for_envvar. ;:'REQUEST_METHOD PATH_INFO QUERY_STRING' do.
>                  val =. safe_getenv>envvar
>                  stdout (>envvar), ': ', val, LF
>          end.
>
>          if. (<safe_getenv 'REQUEST_METHOD') e. ;:'POST PUT'  do.
>                  input =. stdin''
>                  stdout 'Number of characters on stdin: ', (": #input),
> LF
>                  stdout 'stdin data:',LF,input,LF
>          end.
> )
>
> echo +/*:0".>,.2}.ARGV
> first =: _ ".>  {: ARGV
> last  =: _ ".>  {: ARGV
>
> stdout 'Content-Type: text/plain',LF,LF
> show_info''
> exit 0
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to