🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.apps.spreadsheets
Article #276

Re: Help on WINGZ

#276
From: Keith Thorne
Date: Thu, 19 Nov 1992 16:45
81 lines
2614 bytes
Hi,

  I write lots of code in hyper script so if you need other info, keep my
name around.

  Below is a funciton which checks to see if a sheet is open, if not then
open it, if it is open, then bring it to the front.  Here it is...

{**************************************}
Function GET_APP_EDIT()

DEFINE master_sheet, support_path

UNSELECT

master_sheet = name()
support_path = sys_path

SELECT RANGE APP_SPEC
SELECT MORE RANGE TRAFFIC_DATA
COPY

{ opwn the application edit sheet }

GO TO WINDOW sys_path & ":APP_EDIT.WGZ"
IF (kt_utils:sheet_name() <> "APP_EDIT.WGZ")
	OPEN sys_path & ":APP_EDIT.WGZ"
END IF

INVALIDATE ON
PUT master_sheet INTO A50
PUT support_path INTO A51

{SELECT RANGE APP_SPEC}
SELECT RANGE C11
PASTE

UNSELECT

INVALIDATE OFF

REPAINT SELECTIONS ON

END FUNCTION
{**************************************}


sys_path: this is the is a cell in the parent sheet containing the path to
other support files. In my case, the sheet I am going to open is in the
directory contained in the cell named sys_path.

This function copies data from the parent sheet, which is locked, to a
work
sheet for editing. The new, temporary sheet is called APP_EDIT.WGZ and it
will be found in the directory indicated by sys_path.

The code you ask for occurs after the comment { opwn the application edit
sheet }. The funciton kt_utils:sheet_name is a utility function I wrote
allso, included below.

The GO TO WINDOW command will activate the indicated sheet if it is open.
The if statement checks to see if the active window matches the one you
wanted to activate, if the names do not match then the sheet must not have
been open and I make the open call.

If you have any questions, just drop a line.  Here is the other
function...


{**************************************}
function SHEET_NAME()				{ Name of current sheet without path }
define name,col
	name = name()
	col = match(name,":",2)
	while col > 0
		name = mid(name,col,length(name) - col)
		col = match(name,":",2)  {start searching at second char for colon}
	end while
	return (name)
end function
Technical Details
Message-ID: <Bxz2K4.2sq@tridom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!emory!tridom!news
References: <1ef59mINNo56@manuel.anu.edu.au>

Show Full Headers
Complete Article Headers
Newsgroups: comp.apps.spreadsheets
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!emory!tridom!news
From: Keith Thorne <thornek@mis.tridom.com>
Subject: Re: Help on WINGZ
Message-ID: <Bxz2K4.2sq@tridom.com>
X-Xxdate: Thu, 19 Nov 92 12:54:50 GMT
Sender: news@tridom.com
Nntp-Posting-Host: 148.62.4.13
Organization: Tridom
X-Useragent: Nuntius v1.1.1d9
References: <1ef59mINNo56@manuel.anu.edu.au>
Date: Thu, 19 Nov 1992 16:45:40 GMT
Lines: 81