abstruct

vbsutilsは、VBScriptをBATの代わりに利用するための補助ライブラリです。 次のような機能を持っています。

* Array utilities * Logging framework * UNIX shell like procedures * c like formatter

examples

Array utilities

Array utilitiesには、配列を操作するためのプロシージャが用意されています。

examples)

  1. ary = array_create()
  2. array_push ary, 0
  3. array_push ary, 2
  4. for each v in array_filter( ary, "value > 0" )
  5. wscript.echo v
  6. next

Logging framework

Logging frameworkは、log4jライクなログ機能を提供します。

examples)

  1. set logger = log_create_simple("root", "trace.log", LOG_LEVEL_INFO )
  2. log_trace logger, "trace"
  3. log_info logger, "error"

UNIX shell like procedures

UNIX shell like proceduresは、UNIX shellのようなプロシージャを提供します。

examples)

  1. call shell_unprefix()
  2. ' directory
  3. cd "c:"
  4. echo pwd()
  5. ' file
  6. xargs cat( array("f1.txt", "f2.txt"), nothing ), "wscript.echo line", nothing
  7. if not test("-f", "file.txt") then
  8. echo touch(now(), "file.txt").LastModifiedDate
  9. end if
  10. ' jobs
  11. wait array( exec("calc"), exec("calc") )

C like formatter

C like formatterは、printf/sprintf/fprintfを提供します。

  1. wscript.echo sprintf("formatt%+10.1f", array(100.15) )

Latest File Release

vbsutils (0.1.1.1)2013-02-04 00:41

Recent Tickets

(empty)