summaryrefslogtreecommitdiff
path: root/src/DrawResources/OCAFDemo.tcl
blob: f69b83feb72f447edd6f1893bef898281d2f6858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# first , Opening Document write on Unix 
puts "First , Opening Document write on Unix "
set Data [file join [file dirname [file dirname [info script]] TCAF]

set DocName [file join ${Data} FileUnix.std]
if [ file exists ${DocName}  ] {
    
    Open ${DocName} Unix
    DumpDocument Unix
} else {
    puts "  ${DocName} does not exist "
}

# first , Opening Document write on WindowsNT
puts ""
puts "now , Opening Document write on WindowsNT "
puts ""

set DocName [file join ${Data} FileWNT.std]
puts "trying to Open : ${DocName}  "
if  [ file exists  ${DocName} ] {
    catch {  Open ${DocName} WNT } filesta
    if { ${filesta} == "" } { 
	DumpDocument WNT
    } else {
	puts " Problem when trying to read ${DocName}  ==> $filesta "
    }
} else {
    puts "  ${DocName} does not exist "
}
puts "List the Document in the Session :"
ListDocuments

puts ""
puts "now , We create  new Document "
puts ""
NewDocument New MDTV-Standard
UndoLimit New 5
NewCommand New

Label   New  0:20
SetReal New  0:20 .12345


set newName /tmp/New.std
if { [info exists env(TEMP)] } {
    set newName $env(TEMP)/New.std
}
SaveAs New  ${newName}
puts " "
puts "List the Document in the Session :"
ListDocuments
puts " "
puts "We close it"
Close  New
puts "List the Document in the Session :"
ListDocuments

puts "Verify if the new Document is saved : ${newName} "
if   [file exists ${newName}] { 
   puts " ... exists : Yes "
   puts " ... size   : [file size ${newName}]"

   puts " "
   puts " We try to read it :"
   Open ${newName} ReadDoc
   DumpDocument ReadDoc
    puts "List the Document in the Session :"
    ListDocuments
 
}  else {
   puts " ... exists : No "
}
puts " "
puts " "
puts "end "