(saveFormat "2.0")
(date "Tue 02/Jan/1996 20:41:31 MST")
(veerev "3.2")
(platform "PC")
(SaveCF no)
(filterNAN 0)
(component 0 ROOTCONTEXT
 (name "When to use EXECUTE CLOSE for files")
 (implementation
  (retainGlobals YES)
  (locked no)
  (trigMode deg)
  (nextID 14)
  (component 0 SHELLESCAPE
   (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)
	)
	(command "date > /tmp/dateFile")
	(deathWait "Yes")
	(shell "sh")
   )
  )
  (component 1 FORCOUNT
   (name "For Count")
   (interface
	(output 1
	 (name "Count")
	 (lock name constraints)
	)
   )
   (implementation
	(count 10)
   )
  )
  (component 2 FROMFILE
   (interface
	(output 1
	 (name "X")
	 (lock constraints)
	 (optional yes)
	)
   )
   (implementation
	(transactions 2
	  "READ TEXT x STR"
	  "EXECUTE CLOSE"
	)
	(attr iopath file read "/tmp/dateFile"
	 (readTerm "\n")
	 (fs " ")
	 (eol "\n")
	 (multiField fullSyntax)
	 (arrayFormat block)
	)
   )
  )
  (component 3 SCROLLINGTEXTDISPLAY
   (interface
	(input 1
	 (name "Data")
	)
   )
   (implementation
   )
  )
  (component 4 DELAY
   (interface
	(output 1
	 (name "Done")
	 (tag "Done")
	 (lock constraints)
	)
   )
   (implementation
	(delay 0.8)
   )
  )
  (component 5 NOTE
   (name "Warranty Disclaimer")
   (implementation
	(text2 4
	  "This example is provided as an"
	  "illustration \"as is\", and Hewlett-Packard"
	  "Company makes no warranty of any kind"
	  "with regard to this example."
	)
   )
  )
  (component 6 CONTEXT
   (name "Press For")
   (implementation
	(locked no)
	(trigMode deg)
	(nextID 4)
	(component 0 IFTHENELSE
	 (name "!= 0")
	 (interface
	  (input 1
	   (name "A")
	   (optional yes)
	  )
	  (output 1
	   (name "Then")
	   (lock name constraints)
	  )
	  (output 2
	   (name "Else")
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (expr "a!=0")
	 )
	)
	(component 1 TOGGLE25
	 (name "Info About")
	 (interface
	  (input 1
	   (type control)
	   (name "Reset")
	   (lock name constraints)
	   (optional yes)
	  )
	  (output 1
	   (lock name constraints)
	  )
	 )
	 (implementation
	  (value Int32
	   (data  0)
	  )
	  (autoTrigger on)
	  (initValue Int32
	   (data  0)
	  )
	 )
	)
	(component 2 CONTEXT
	 (name "Info About...")
	 (implementation
	  (locked no)
	  (trigMode deg)
	  (nextID 2)
	  (popupMoveable)
	  (component 0 CONFIRM25
	   (name "DONE")
	   (interface
		(output 1
		 (name "Go")
		 (lock name constraints)
		)
	   )
	   (implementation
		(component enterButton yes)
		(component escapeButton yes)
	   )
	  )
	  (component 1 NOTE
	   (name "Info About")
	   (implementation
		(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
	   (geometry 5 62 816 518)
	   (panel
		(geometry 129 -133 812 496)
		(gridSize 2)
		(widget 0 detail
		 (title off)
		 (borderStyle flat)
		 (geometry 501 309 70 37)
		)
		(widget 1 detail
		 (title off)
		 (borderStyle none)
		 (geometry 135 -129 800 430)
		 (editing disabled)
		)
	   )
	  )
	 )
	)
	(component 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)
	)
   )
  )
  (component 7 EXITPROCESS
   (implementation
	(comp code 0)
   )
  )
  (component 9 IFTHENELSE
   (interface
	(input 1
	 (name "A")
	 (optional yes)
	)
	(output 1
	 (name "Then")
	 (lock name constraints)
	)
	(output 2
	 (name "Else")
	 (lock name constraints)
	)
   )
   (implementation
	(expr "a==\"Windows_NT\" OR a==\"Windows_95\"")
   )
  )
  (component 10 PCEXECPROG
   (implementation
	(command "command.com /c ver > dosver.txt")
	(deathWait "Yes")
	(runStyle "Minimized")
	(workingDir "")
   )
  )
  (component 11 JUNCTION
   (name "JCT")
   (interface
	(input 1
	 (name "A")
	 (lock name constraints)
	)
	(input 2
	 (name "B")
	 (lock name constraints)
	)
	(output 1
	 (name "Data")
	 (lock name constraints)
	)
   )
  )
  (component 12 FROMFILE
   (interface
	(output 1
	 (name "X")
	 (lock constraints)
	 (optional yes)
	)
   )
   (implementation
	(transactions 2
	  "READ TEXT x STR"
	  "EXECUTE CLOSE"
	)
	(attr iopath file read "dosver.txt"
	 (readTerm "\n")
	 (fs " ")
	 (eol "\n")
	 (multiField fullSyntax)
	 (arrayFormat block)
	)
   )
  )
  (component 13 FORMULA
   (name "whichOS()")
   (interface
	(output 1
	 (name "Result")
	 (lock name constraints)
	)
   )
   (implementation
	(expr 1 "whichOS()")
   )
  )
  (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)
  )
 )
 (viewFor -1
  (active detail)
  (detail
   (geometry 0 28 1012 690)
   (configuration
	(viewFor 0
	 (active detail)
	 (icon
	  (iconImage "c.icn")
	 )
	 (detail
	  (geometry 60 241 331 99)
	 )
	 (terminals on)
	)
	(viewFor 1
	 (active detail)
	 (icon
	  (iconImage "loop.icn")
	 )
	 (detail
	  (geometry 24 62 153 36)
	 )
	)
	(viewFor 2
	 (active detail)
	 (icon
	 )
	 (detail
	  (geometry 122 374 237 92)
	 )
	 (terminals on)
	)
	(viewFor 3
	 (active detail)
	 (icon
	 )
	 (detail
	  (geometry 561 513 359 195)
	  (bufferSize 256)
	 )
	)
	(viewFor 4
	 (active icon)
	 (icon
	  (geometry 201 98 78 25)
	 )
	 (detail
	  (geometry 180 122 120 36)
	 )
	)
	(viewFor 5
	 (active icon)
	 (icon
	  (geometry 661 56 338 48)
	  (iconImage "disclaim.icn")
	  (label off)
	 )
	 (detail
	  (geometry 557 278 387 85)
	  (editing disabled)
	 )
	)
	(viewFor 6
	 (active panel)
	 (icon
	  (geometry 405 628 110 25)
	 )
	 (panel
	  (geometry 321 92 319 77)
	  (widget 1 detail
	   (title off)
	   (borderStyle flat)
	   (geometry 423 105 114 39)
	   (scaled on)
	   (format button)
	  )
	 )
	 (detail
	  (geometry 108 78 625 524)
	  (configuration
	   (viewFor 0
		(active icon)
		(icon
		 (geometry 366 272 46 25)
		)
		(detail
		 (geometry 209 308 73 64)
		)
		(terminals on)
	   )
	   (viewFor 1
		(active detail)
		(icon
		 (geometry -40 -7 81 15)
		)
		(detail
		 (geometry 202 265 114 39)
		 (scaled on)
		 (format button)
		)
		(title off)
	   )
	   (viewFor 2
		(active icon)
		(icon
		 (geometry 413 315 127 25)
		)
		(detail
		 (geometry 55 140 850 500)
		 (configuration
		  (viewFor 0
		   (active detail)
		   (icon
			(geometry -22 -7 45 15)
		   )
		   (detail
			(geometry 451 502 58 37)
		   )
		   (title off)
		  )
		  (viewFor 1
		   (active icon)
		   (icon
			(geometry 425 388 110 25)
		   )
		   (detail
			(geometry 66 186 829 428)
			(editing disabled)
		   )
		  )
		 )
		 (stackingOrder 0 1)
		)
	   )
	   (viewFor 3
		(active icon)
		(icon
		 (geometry 126 110 110 64)
		 (iconImage "loop.icn")
		)
		(detail
		)
		(terminals on)
	   )
	   (connect D1:1 D0:1
		(points 2 318 284 363 284)
	   )
	   (connect D3:1 D1:0
		(points 3 238 142 259 142 259 262)
	   )
	   (connect D2:0 D1:1
		(points 5 476 342 476 362 181 362 181 284 199 284)
	   )
	   (connect D0:1 D2:0
		(points 3 414 274 476 274 476 312)
	   )
	  )
	  (stackingOrder 0 1 3 2)
	 )
	)
	(viewFor 7
	 (active icon)
	 (icon
	  (geometry 77 118 46 25)
	 )
	 (detail
	  (geometry 55 184 110 32)
	 )
	)
	(viewFor 9
	 (active icon)
	 (icon
	  (geometry 104 165 112 31)
	 )
	 (detail
	  (geometry 185 177 400 66)
	 )
	 (terminals on)
	)
	(viewFor 10
	 (active detail)
	 (icon
	  (iconImage "c.icn")
	 )
	 (detail
	  (geometry 526 238 428 105)
	 )
	 (terminals on)
	)
	(viewFor 11
	 (active icon)
	 (icon
	  (geometry 446 645 48 31)
	 )
	 (detail
	 )
	 (terminals on)
	)
	(viewFor 12
	 (active detail)
	 (icon
	 )
	 (detail
	  (geometry 627 379 227 82)
	 )
	 (terminals on)
	)
	(viewFor 13
	 (active icon)
	 (icon
	  (geometry 15 172 71 16)
	 )
	 (detail
	 )
	 (terminals on)
	)
	(connect D8:2 D0:0
	 (points 3 218 190 240 190 240 220)
	)
	(connect D0:0 D2:0
	 (points 2 240 342 240 353)
	)
	(connect D10:1 D3:1
	 (points 4 496 660 520 660 520 610 558 610)
	)
	(connect D1:1 D4:0
	 (points 3 179 80 240 80 240 95)
	)
	(connect D1:0 D7:0
	 (points 2 100 100 100 115)
	)
	(connect D4:1 D8:0
	 (points 5 281 110 300 110 300 150 160 150 160 162)
	)
	(connect D12:1 D8:1
	 (points 2 88 180 101 180)
	)
	(connect D8:1 D9:0
	 (points 5 218 170 250 170 250 200 740 200 740 217)
	)
	(connect D11:1 D10:1
	 (points 6 886 420 910 420 910 470 420 470 420 650 443 650)
	)
	(connect D2:1 D10:2
	 (points 4 391 420 410 420 410 670 443 670)
	)
	(connect D9:0 D11:0
	 (points 2 740 345 740 358)
	)
   )
   (stackingOrder 1 7 4 10 12 8 0 9 11 2
	 3 6 5)
  )
  (titleBg "Gray")
  (titleFg "Black")
  (numberFormats
   (realFormat standard)
   (realSigDigits 4)
   (realRadixSpec 4)
   (integerBase decimal)
  )
 )
)
