You are here

Ini 1.0.0.0

admin의 아바타
첨부 파일파일 크기
Package icon ini840.zip15.45 KB

홈페이지 : http://www.du.edu/~mschwart/tcl-tk.htm

INI file manipulation

Windows and Unix

Unix code includes functions for complete INI file support in C as well as the code for the static or dynamic extension

Formerly known as the "profile" extension

# Tests most of the functions in the ini extension.
# Assumes it is tested where the archive was unpacked.
# Results should be exactly the same as in "expect0.ini"
  lappend auto_path .
  package require ini
  ini dir .

  # Enter some starting values
  ini set -section "Section1" -key "Entry1" -value "Value1" -private testprof.ini
  ini set -section "Section1" -key "Entry2" -value "Value2" -private testprof.ini
  ini set -section "Section1" -key "Entry3" -value "Value3" -private testprof.ini
  ini set -section "Section2" -key "Entry1" -value "Value1" -private testprof.ini
  ini set -section "Section2" -key "Entry2" -value "Value2" -private testprof.ini
  ini set -section "Section2" -key "Entry3" -value "Value3" -private testprof.ini
  ini set -section "Section1" -key "Entry4" -value "Value4" -private testprof.ini
  ini set -section "Section1" -key "Entry2" -value "New Value2 inserted" -private testprof.ini
  ini set -section "Section3" -key "Entry1" -value "Value1a" -private testprof.ini
  ini set -section "Section3" -key "Entry2" -value "Value2a" -private testprof.ini
  ini set -section "Section3" -key "Entry3" -value "Value3a" -private testprof.ini
  ini set -section "Section3" -key "Entry4" -value "Value4a" -private testprof.ini
  ini set -section "Section3" -key "Entry2" -value "Value2b" -private testprof.ini
  ini set -section "Multi word section" -key "Multi word entry" -value "multi word value" -private testprof.ini

  # Delete some values
  ini delete -section "Section1" -key "Entry2" -private testprof.ini 
  ini delete -section "Section3" -key "Entry5" -private testprof.ini 
                                                           
  ini delete -section "Section5" -key "Entry1" -private testprof.ini 
                                                           

  # Delete a section
  ini delete -section "Section2"  -private testprof.ini