📄 test.tcl
字号:
proc ShowUdpDefnProp {id} { global fp puts $fp " <---- properties ----" puts $fp " npiName=[npi_get $id -npiName]" puts $fp " npiFullName=[npi_get $id -npiFullName]" puts $fp " npiType=[npi_get $id -npiType]" puts $fp " npiFile=[npi_get $id -npiFile]" puts $fp " npiLineNo=[npi_get $id -npiLineNo]" puts $fp " npiDefName=[npi_get $id -npiDefName]" puts $fp " npiSize=[npi_get $id -npiSize]" puts $fp " npiPrimType=[npi_get $id -npiPrimType]" puts $fp " >---- properties ----"}proc foreach_IODecl {iter_handle iter_type} { global fp puts $fp " <---$iter_type --->" set Object_Handle [npi_scan $iter_handle] while {$Object_Handle != "NULL"} { puts $fp " <---begin npi_scan \$iter_handle--->" puts $fp " npiType = [npi_get $Object_Handle -npiType]" puts $fp " npiFile = [npi_get $Object_Handle -npiFile]" puts $fp " npiLineNo = [npi_get $Object_Handle -npiLineNo]" puts $fp " <---end of npi_scan \$iter_handle--->" set Object_Handle [npi_scan $iter_handle] } puts $fp " <---end of $iter_type --->"}proc foreach_TableEntry {iter_handle iter_type} { global fp puts $fp " <---$iter_type --->" set Object_Handle [npi_scan $iter_handle] while {$Object_Handle != "NULL"} { puts $fp " <---begin npi_scan \$iter_handle--->" puts $fp " npiType = [npi_get $Object_Handle -npiType]" puts $fp " npiFile = [npi_get $Object_Handle -npiFile]" puts $fp " npiLineNo = [npi_get $Object_Handle -npiLineNo]" puts $fp " npiSize = [npi_get $Object_Handle -npiSize]" puts $fp " <---end of npi_scan \$iter_handle--->" set Object_Handle [npi_scan $iter_handle] } puts $fp " <---end of $iter_type --->"}proc ShowHandleProp {Handle type} { global fp puts $fp " <---$type --->" puts $fp " Type = [npi_get $Handle -npiType]" puts $fp " Name = [npi_get $Handle -npiName]" puts $fp " LineNo = [npi_get $Handle -npiLineNo]" puts $fp " <---end of $type --->"}proc ShowUdpDefnRelationship {id} { global fp puts $fp " <---relationship --->" set IODecl_Iter [npi_iterate $id -npiType npiIODecl] foreach_IODecl $IODecl_Iter "npi_iterate \$id -npiType npiIODecl" set TableEntry_Iter [npi_iterate $id -npiType npiTableEntry] foreach_TableEntry $TableEntry_Iter "npi_iterate \$id -npiType npiTableEntry" set initial_handle [npi_handle $id -npiType npiInitial] if {$initial_handle != "NULL"} { ShowHandleProp $initial_handle "npi_handle \$id -npiType npiInitial" } puts $fp " <---end of relationship --->"}proc ShowUdpDefnPropAndRelationship {UdpDefn} { global fp set var $UdpDefn puts $fp "<---begin showing UdpDefn information--->" ShowUdpDefnProp $var ShowUdpDefnRelationship $var puts $fp "<---end of showing UdpDefn information--->"}set log_file [file join [file dirname [info script]] [file tail [info script]].out]set fp [open $log_file w]fconfigure $fp -buffering noneset UdpDefn_Iter [npi_iterate NULL -npiType npiUdpDefn]set UdpDefn [npi_scan $UdpDefn_Iter]while {$UdpDefn != "NULL"} { ShowUdpDefnPropAndRelationship $UdpDefn set UdpDefn [npi_scan $UdpDefn_Iter]}close $fp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -