home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / apps / spreadsh / 670 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.5 KB  |  96 lines

  1. Newsgroups: comp.apps.spreadsheets
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!emory!tridom!news
  3. From: Keith Thorne <thornek@mis.tridom.com>
  4. Subject: Re: Help on WINGZ
  5. Message-ID: <Bxz2K4.2sq@tridom.com>
  6. X-Xxdate: Thu, 19 Nov 92 12:54:50 GMT
  7. Sender: news@tridom.com
  8. Nntp-Posting-Host: 148.62.4.13
  9. Organization: Tridom
  10. X-Useragent: Nuntius v1.1.1d9
  11. References: <1ef59mINNo56@manuel.anu.edu.au>
  12. Date: Thu, 19 Nov 1992 16:45:40 GMT
  13. Lines: 81
  14.  
  15.  
  16. Hi,
  17.  
  18.   I write lots of code in hyper script so if you need other info, keep my
  19. name around.
  20.  
  21.   Below is a funciton which checks to see if a sheet is open, if not then
  22. open it, if it is open, then bring it to the front.  Here it is...
  23.  
  24. {**************************************}
  25. Function GET_APP_EDIT()
  26.  
  27. DEFINE master_sheet, support_path
  28.  
  29. UNSELECT
  30.  
  31. master_sheet = name()
  32. support_path = sys_path
  33.  
  34. SELECT RANGE APP_SPEC
  35. SELECT MORE RANGE TRAFFIC_DATA
  36. COPY
  37.  
  38. { opwn the application edit sheet }
  39.  
  40. GO TO WINDOW sys_path & ":APP_EDIT.WGZ"
  41. IF (kt_utils:sheet_name() <> "APP_EDIT.WGZ")
  42.     OPEN sys_path & ":APP_EDIT.WGZ"
  43. END IF
  44.  
  45. INVALIDATE ON
  46. PUT master_sheet INTO A50
  47. PUT support_path INTO A51
  48.  
  49. {SELECT RANGE APP_SPEC}
  50. SELECT RANGE C11
  51. PASTE
  52.  
  53. UNSELECT
  54.  
  55. INVALIDATE OFF
  56.  
  57. REPAINT SELECTIONS ON
  58.  
  59. END FUNCTION
  60. {**************************************}
  61.  
  62.  
  63. sys_path: this is the is a cell in the parent sheet containing the path to
  64. other support files. In my case, the sheet I am going to open is in the
  65. directory contained in the cell named sys_path.
  66.  
  67. This function copies data from the parent sheet, which is locked, to a
  68. work
  69. sheet for editing. The new, temporary sheet is called APP_EDIT.WGZ and it
  70. will be found in the directory indicated by sys_path.
  71.  
  72. The code you ask for occurs after the comment { opwn the application edit
  73. sheet }. The funciton kt_utils:sheet_name is a utility function I wrote
  74. allso, included below.
  75.  
  76. The GO TO WINDOW command will activate the indicated sheet if it is open.
  77. The if statement checks to see if the active window matches the one you
  78. wanted to activate, if the names do not match then the sheet must not have
  79. been open and I make the open call.
  80.  
  81. If you have any questions, just drop a line.  Here is the other
  82. function...
  83.  
  84.  
  85. {**************************************}
  86. function SHEET_NAME()                { Name of current sheet without path }
  87. define name,col
  88.     name = name()
  89.     col = match(name,":",2)
  90.     while col > 0
  91.         name = mid(name,col,length(name) - col)
  92.         col = match(name,":",2)  {start searching at second char for colon}
  93.     end while
  94.     return (name)
  95. end function
  96.