Crazy idea... probably not feasable... imagination needed!

Hi All!!!

I have a crazy question…

I have an agent that creates many documents. That agent is run by a “non designer” which have capabilities in programming.

That agent, written in LotusScript, have some “SUB” used to tweak the results of the documents created.

For now, that part of the code is hard-coded in the agent, and I want to give control to that SUB, whitout giving designer access to the DB.

I was thinking creating a LSS file, and have a form, in the DB, that open that LSS file. I am pretty confident it will work.

But I would like to have, in that form, a field, where the code is, that look like a LotusScript programmer’s pane… with color coding etc…

Does someone know if the programmer’s pane is stored as an object or component (ocx or dll) and can be inserted in a form? I tried to find it in the object insertion window, but it does not seems to be listed there.

Thanks.

Sebastien Gignac

Subject: Crazy idea… probably not feasable… imagination needed!!!

LSS files are not needed when the agent is run, they are only needed when you recompile the agent. Thus, if you change the LSS file without resaving the agent, the changes in the LSS file are ignored. But what you could do is to give them access to another database, which has an agent where this sub exists, so they could change the external agent without needing designer access to the main agent, and still have full syntax highlightning and formatting in designer. From the main agent you can call the external agent with any parameters you need.

Subject: RE: Crazy idea… probably not feasable… imagination needed!!!

That is a really good point about the LSS file.

Do you think it is possible, to have a LotusScript agent, read a field on form, containing LotusScript code, and execute it?

That is a very good idea to create a separate database… I’ll look into it.

Thanks

Sebastien Gignac.

Subject: RE: Crazy idea… probably not feasable… imagination needed!!!

Yes, you can compile any text into an executable LotusScript agent, so you can also get the text from a field on a document. But then you don’t have Designer Help, Error Checking and Syntax Highlightning and Auto Formatting, which are a few of the best things in Notes/Domino!

There are various ways to compile a text into executable LotusScript code:

  1. The Execute statement in LotusScript

  2. Import the text as DXL into an agent (some XML wrapping needed)

  3. Write the text into an LSS file and compile an agent which includes that LSS file programmatically.

But anyways, I would still go with a seperate database and have a freely modificable agent there.

Subject: yeah thanks Mika!

That finally sparked in my mind the answer to a posting I had made waaay back… . Evaluate was mentioned, no idea why it didn’t occur to me then…

I have a bunch of functions, one for each form, with the same name as the form (glad I set it up that way anyway!). I thought it would be cool to just be able to Call NotesDocument.Form(0)… and have it fire the function for that form. Seems so simple to me now I could cry! Now I can write one script library sub and call it from whatever form, instead of hard coding the same basic code (with slight customization) on many different forms:

Execute( "Call " & NotesDocument.Form(0) & “( paremeter1, parameter2, etc )” )

The code is actually quite a bit more complicated than that simple example, with hierarchies and related documents and such to go through, but it won’t be anywhere near as complicated as I was getting in that original thread :slight_smile: I’m off for a genericize session… thanks again!

Subject: RE: Crazy idea… probably not feasable… imagination needed!!!

Mika,

You know what, I am programming LS since about 7 years, and this is the first time I heard about the execute function.

Thanks for the hints.

Sebastien Gignac