(saveFormat "2.3")
(date "Thu 26/Feb/2004 20:16:59 ")
(veerev "6.2")
(platform "PC")
(execMode v6)
(prefExecMode v8)
(filterNAN 0)
(workspaceStackingOrder M)
(SaveCF no)
(device 0 ROOTCONTEXT
(properties
(trigMode deg)
(nextID 17)
(popupTitleText "When to use EXECUTE CLOSE for files")
(popupMoveable 1)
(popupTitleTextColor "Black")
(popupTitleBackgroundColor "Gray")
(deleteGlobals 0))
(deviceList
(device 0 SHELLESCAPE
(properties
(command "date > /tmp/dateFile")
(shell sh))
(interface
(output 1
(name "Exit code")
(lock name constraints)))
(implementation
(attr iopath pipe read "pipe"
(readTerm "\n")
(fs " ")
(eol "\n")
(multiField fullSyntax)
(arrayFormat block))
(attr iopath pipe write "pipe"
(readTerm "\n")
(fs " ")
(eol "\n")
(multiField fullSyntax)
(arrayFormat block))))
(device 1 FORCOUNT
(properties
(count 10))
(interface
(output 1
(name "Count")
(lock name constraints))))
(device 2 FROMFILE
(properties
(transactions 2 "READ TEXT x STR" "EXECUTE CLOSE"))
(interface
(output 1
(name "X")
(optional yes)))
(implementation
(attr iopath file read "/tmp/dateFile"
(readTerm "\n")
(fs " ")
(eol "\n")
(multiField fullSyntax)
(arrayFormat block))))
(device 3 SCROLLINGTEXTDISPLAY
(properties
(logSize 256))
(interface
(input 1
(name "Data"))))
(device 4 DELAY
(properties
(delay 0.8))
(interface
(output 1
(name "Done")
(tag "Done"))))
(device 5 NOTE
(properties
(name "Warranty Disclaimer")
(text2 4 "This example is provided as an"
"illustration \"as is\", and Agilent Technologies"
"makes no warranty of any kind" "with regard to this example.")))
(device 6 CONTEXT
(properties
(name "Press For")
(trigMode deg)
(nextID 4))
(deviceList
(device 0 IFTHENELSE
(properties
(name "!= 0")
(cases 1 "a!=0"))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Then")
(lock name constraints))
(output 2
(name "Else")
(lock name constraints))))
(device 1 TOGGLE25
(properties
(name "Info About")
(autoTrigger 1))
(interface
(input 1
(type control)
(name "Reset")
(lock name constraints)
(optional yes))
(output 1
(lock name constraints)))
(implementation
(value Int32
(data  0))
(initValue Int32
(data  0))))
(device 2 CONTEXT
(properties
(name "Info About...")
(trigMode deg)
(nextID 2)
(popupMoveable 1))
(deviceList
(device 0 CONFIRM25
(properties
(name "DONE"))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 1 NOTE
(properties
(name "Info About")
(text2 24 "Overview: "
"  This program demonstrates the situations where a EXECUTE CLOSE must be done "
"  on a file in order for a program to run correctly." "" "Details:"
"  Under UNIX, \"Execute Program\" executes in the \"Pgm with params\" "
"  field \"date > /tmp/dateFile\" which creates the file \"/tmp/dateFile\" and places "
"  the current time and date into that file.  Under Microsoft Windows, \"Execute "
"  Program\" executes in the \"Pgm with params\" field \"command.com /c ver > dosver.txt\""
"  which creates the file \"dosver.txt\" in the current directory and places the DOS"
"  version into that file.  \"From File\" reads the time and date string and displays it in "
"  \"Logging AlphaNumeric\".  Since the thread is executed multiple times by \"For Count\", "
"  succeeding executions of \"Execute Program\" will overwrite the file.  However, since "
"  \"From File\" only opens the file once, upon the second execution of \"From File\" the "
"  read pointer will be stale; it will no longer point to the file since \"Execute Program\" "
"  has re-created the file. An error would occur." ""
"  \"From File\" must close the file after each READ transaction by using the "
"  EXECUTE CLOSE transaction. The EXECUTE CLOSE transaction forces \"FROM FILE\""
"  to re-open the file on every execution." ""
"  The program can demonstrate the error by using NOP to preceed the EXECUTE "
"  CLOSE transaction. The error will state \"End of file or no data found\". "
"  Removing the NOP will cause the program to run normally.")))
(configuration)
(ShowOnExecPanel
(relativeOrigin 5 32)))
(contextCarrier
(active detail)
(panel
(extent 812 496)
(gridSize 2)
(widget 0 detail
(relativeOrigin 370 440)
(title off)
(borderStyle flat)
(extent 70 37))
(widget 1 detail
(relativeOrigin 6 4)
(title off)
(borderStyle none)
(extent 800 430)
(editing disabled)))
(detail
(extent 850 500)
(anchorPt 425 380)
(configuration
(devCarrierFor 0
(active open)
(icon
(extent 45 15))
(open
(extent 58 37))
(title off)
(pinCenter 0 0))
(devCarrierFor 1
(active icon)
(icon
(extent 110 25))
(open
(extent 829 428)
(editing disabled))
(pinCenter 0 -120)))
(stackingOrder 0 1))))
(device 3 REPEATUNTILBREAK
(interface
(output 1
(name "Continuous")
(lock name constraints))))
(configuration
(connect D1:1 D0:1)
(connect D3:1 D1:0)
(connect D2:0 D1:1)
(connect D0:1 D2:0)))
(contextCarrier
(active panel)
(panel
(extent 319 77)
(widget 1 detail
(relativeOrigin 100 11)
(title off)
(borderStyle flat)
(extent 114 39)
(scaled on)
(format button)))
(detail
(extent 625 524)
(anchorPt 281 206)
(configuration
(devCarrierFor 0
(active icon)
(icon
(extent 46 25))
(open
(extent 73 64))
(terminals on)
(pinCenter 0 0))
(devCarrierFor 1
(active open)
(icon
(extent 81 15))
(open
(extent 114 39)
(scaled on)
(format button))
(title off)
(pinCenter -130 0))
(devCarrierFor 2
(active icon)
(icon
(extent 127 25))
(open
(extent 812 496)
(carbonCopy))
(bg "Light Blue Gray")
(pinCenter 87 43))
(devCarrierFor 3
(active icon)
(icon
(extent 110 64)
(iconImage "loop.icn"))
(open)
(terminals on)
(pinCenter -208 -142))
(connect D1:1 D0:1
(points 2 -71 0 -26 0))
(connect D3:1 D1:0
(points 3 -151 -142 -130 -142 -130 -22))
(connect D2:0 D1:1
(points 5 87 58 87 78 -208 78 -208 0 -190 0))
(connect D0:1 D2:0
(points 3 25 -10 87 -10 87 28)))
(stackingOrder 0 1 3 2))))
(device 7 EXITPROCESS
(properties
(code 0)))
(device 9 IFTHENELSE
(properties
(cases 1 "a==\"PC\""))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Then")
(lock name constraints))
(output 2
(name "Else")
(lock name constraints))))
(device 10 PCEXECPROG
(properties
(command "command.com /c ver > dosver.txt")
(runStyle Minimized)
(workingDir "")))
(device 11 JUNCTION
(properties
(name "JCT"))
(interface
(input 1
(name "A"))
(input 2
(name "B"))
(output 1
(name "Data")
(lock name constraints))))
(device 12 FROMFILE
(properties
(transactions 2 "READ TEXT x STR" "EXECUTE CLOSE"))
(interface
(output 1
(name "X")
(optional yes)))
(implementation
(attr iopath file read "dosver.txt"
(readTerm "\n")
(fs " ")
(eol "\n")
(multiField fullSyntax)
(arrayFormat block))))
(device 16 FORMULA
(properties
(name "whichPlatform()")
(expr 1 "whichPlatform()"))
(interface
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(configuration
(connect D8:2 D0:0)
(connect D0:0 D2:0)
(connect D10:1 D3:1)
(connect D1:1 D4:0)
(connect D1:0 D7:0)
(connect D4:1 D8:0)
(connect D12:1 D8:1)
(connect D8:1 D9:0)
(connect D11:1 D10:1)
(connect D2:1 D10:2)
(connect D9:0 D11:0)))
(contextCarrier
(wndOrigin 2 2)
(wndState res)
(active detail)
(detail
(extent 1012 690)
(anchorPt 316 277)
(configuration
(devCarrierFor 0
(active open)
(icon
(iconImage "c.icn"))
(open
(extent 331 99))
(terminals on)
(pinCenter -15 0))
(devCarrierFor 1
(active open)
(icon
(iconImage "loop.icn"))
(open
(extent 153 36))
(pinCenter -140 -210))
(devCarrierFor 2
(active open)
(icon)
(open
(extent 237 92))
(terminals on)
(pinCenter 0 130))
(devCarrierFor 3
(active open)
(icon)
(open
(extent 359 195)
(noformatter))
(pinCenter 500 320))
(devCarrierFor 4
(active icon)
(icon
(extent 78 25))
(open
(extent 120 36))
(pinCenter 0 -180))
(devCarrierFor 5
(active icon)
(icon
(extent 338 48)
(iconImage "disclaim.icn")
(label off))
(open
(extent 387 85)
(editing disabled))
(pinCenter 590 -210))
(devCarrierFor 6
(active open)
(icon
(extent 110 25))
(open
(extent 319 77)
(carbonCopy))
(bg "Light Blue Gray")
(pinCenter 240 -160))
(devCarrierFor 7
(active icon)
(icon
(extent 46 25))
(open
(extent 110 32))
(pinCenter -140 -160))
(devCarrierFor 9
(active icon)
(icon
(extent 112 31))
(open
(extent 72 66))
(terminals on)
(pinCenter -90 -110))
(devCarrierFor 10
(active open)
(icon
(iconImage "c.icn"))
(open
(extent 428 105))
(terminals on)
(pinCenter 500 0))
(devCarrierFor 11
(active icon)
(icon
(extent 48 31))
(open)
(terminals on)
(pinCenter 230 370))
(devCarrierFor 12
(active open)
(icon)
(open
(extent 227 82))
(terminals on)
(pinCenter 500 130))
(devCarrierFor 16
(active icon)
(icon
(extent 94 15))
(open
(extent 117 31))
(terminals on)
(pinCenter -240 -110))
(connect D8:2 D0:0
(points 3 -32 -100 0 -100 0 -70))
(connect D0:0 D2:0
(points 2 0 52 0 63))
(connect D10:1 D3:1
(points 4 256 370 280 370 280 320 318 320))
(connect D1:1 D4:0
(points 3 -61 -210 0 -210 0 -195))
(connect D1:0 D7:0
(points 2 -140 -190 -140 -175))
(connect D4:1 D8:0
(points 7 41 -180 60 -180 60 -140 -10 -140 -10 -150 -90 -150 -90 -128))
(connect D12:1 D8:1
(points 2 -191 -110 -149 -110))
(connect D8:1 D9:0
(points 5 -32 -120 10 -120 10 -100 500 -100 500 -73))
(connect D11:1 D10:1
(points 6 646 130 670 130 670 180 180 180 180 360 203 360))
(connect D2:1 D10:2
(points 4 151 130 170 130 170 380 203 380))
(connect D9:0 D11:0
(points 2 500 55 500 68)))
(stackingOrder 1 7 4 10 0 9 11 2 3 6 5 12 8))
(numberFormats
(realFormat standard)
(realSigDigits 4)
(realRadixSpec 4)
(integerBase decimal))))
