Tcl & Tk/확장 패키지 (Extension Package)
Ini 1.0.0.0
ihmin
2025. 2. 14. 09:59
홈페이지 : http://www.du.edu/~mschwart/tcl-tk.htm
INI 파일을 취급하는 확장 패키지로 윈도우즈와 유닉스를 지원합니다. 소스코드 포함입니다.
# 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