'-------------------------------------------------------------------- 'SCRIPT: avu-EchoSED 'PROJECT: gavos.apr, avcsus 'DATE: 03-22-96, 02-02-96 JG 'AUTHOR: John Ganter, Sandia National Labs, jganter@sandia.gov 'DESC: provides an System.Echo window (a SEd) for Windows Avenue ' developers. Can also be used on platforms that do support ' System.Echo, since it provides convenient save, print, and ' copy/cut/paste functions. 'CALL AS: av.Run("avu-EchoSED", "New&Echo|" + strThe) 'ARG01: "Echo" ' "New&Echo" = makes a new SED, then enchos 'RETURNS: 'EXPECTS: 'CALLS TO: '-------------------------------------------------------------------- 'Note that the delimiter is a "|" character. 'Notes: 'Remember, you can save, print, and copy/cut/paste from the SED ' 'You do need to send a string. If needed, do this: 'stringMine = numberMine.AsString 'extract request and arguments lstArguments = SELF.AsTokens("|") rRequest = lstArguments.Get(0) strNew = lstArguments.Get(1) 'inital size of window; can be changed by dragging numEchoSEDHi = 150 numEchoSEDWi = 600 'remove the SED if requested If ( (rRequest = "New&Echo") and (_EchoSED <> Nil) ) then 'delete the SED av.GetProject.RemoveDoc(_EchoSED) '_EchoSEDwin = Nil end 'if the SED is missing, build a new one 'refresh the _EchoSED object/handle by finding a document 'with its name. If nil is returned, the document is gone even 'though the global handle is present _EchoSED = av.GetProject.FindDoc(_EchoSED.GetName) if (_EchoSED = Nil) then 'for some reason, you have to MakeFromSource, rather than 'just Make, and then fill in below _EchoSED = SEd.MakeFromSource(strNew,"") _EchoSEDwin = _EchoSED.GetWin _EchoSEDwin.Resize(numEchoSEDWi, numEchoSEDHi) end 'update the SED 'find the last character and position the cursor strPresent = _EchoSED.GetSource numCharLast = strPresent.Count _EchoSED.SetInsertPos(numCharLast) if ( numCharLast = 0 ) then 'if there is no text, no newline strPrefix = "" Else strPrefix = NL 'if there is already text, add a newline End 'prepare and insert the string, update the SED title strPut = strPrefix + strNew _EchoSED.Insert(strPut) strLabel = "Echo SED Window:" ++ Date.Now.AsString _EchoSED.SetName(strLabel) 'make sure the SEd is open and activated _EchoSEDwin.Open _EchoSEDwin.Activate 'MsgBox.Info(_EchoSED.GetSource.Count.AsString,"") '----end of script---------------------------------------------------