Another question I have is, does lotus script employ the concept of
modules, ie can I include files, with functions, declarations and subs
therin.
Any advice would be appreciated
Regards
Sean Laval
Tell me something: why the hell do you want to jump into the API if you
have LS? Considering that LS itself in Notes is a loose wrapper around the
API? Considering the lack of pointer support, I can't see why you would
want to.
--
Darrin Tisdale
Chief Architect, LS S&T
Lotus Development
I have not tried it, nor would I want to. Instead, if I need the API for
anything, I just create a C++ dll with the new Notes C++ API, and then I
pass over the items I need as parameters. Presto, the function works
wicked fast. I do distrubute the DLL, but that's not a problem with Notes
4.5--you can create auto installers.
The longer version of the answer is: I understand that you want to
leverage your investment in Visual Basic programming, and LotusScript
will help you with that. I'd encourage you, though, to thoroughly
acquaint yourself with the Notes macro and @command environment first.
There are a lot of places within forms where they make more sense than
LotusScript. In the places where LotusScript makes sense, you can use
the NotesUIWorkSpace, NotesUIDocument, and NotesDocument classes
(among others) to manipulate the Notes environment from LotusScript.
The longer answer to the second question is that yes, LotusScript can
use modules, functions, and declarations. It's an odd blend, though,
because you're not using a completely separate language, but a
language grafted onto Notes. LotusScript is largely compatible with
Visual Basic, but there are differences in approach and perspective
(mindset things) that can bite you. That's why I encourage you to
become familiar with the whole Notes environment first.
Hope this helps!
Yes, you can develop modules in your code, although in some contexts (like
action bar buttons) you are limited. Normally, just go to the declarations
event and type in sub <subname> and the module will be created for you.
Sean Laval <se...@seannfud.demon.co.uk> wrote in article
<VA.0000006...@seannfud.demon.co.uk>...
> Can it be done? I presume so. What I would really like is all the api
> function declarations ...
Why would I want to do it?
Well, the other day a colleague of mine was working in script and
needed to convert a full hierarchical server name ie CN= ... OU= etc to
its canonicalized equivalent. Notes macro language does provide an easy
way to do this but we had problems calling the @Name from script. We
were probably just using 'Evaluate' incorrectly but nevertheless I
looked at the api documentation and there is a function that will do
the job for us.
The issue about lack of pointer support.. well that is the sort of
thing I am trying to find out. For instance in vb3, strings passed into
an api function byval are automatically null terminated and a reference
passed (in readiness for the C api). Does LotusScript do the same? I
know that certain functions will be just out of scope from script, eg
ones that require pointers to call back functions etc.
I take the point about creating a dll to to the job, though personally
I'd prefer to call into the notes libraries.
Terrance,
Thanks for your reply. I couldn't see a reason why it couldn't be done.
What do you think of what Darren has said? I suppose he is in the
'know' as to why one shouldn't do what I am proposing. I suppose I am
frustrated by the lack of support in script for certain features that
the macro language provides. If you call into the notes libraries from
script, what sort of areas do you find it necessary.
Sean
ps I suppose I should become a C programmer!
Tim Duthie
Noteable! Inc.
LNCAD
* * * * Original Message * * * *
Darren
Terrance,
Sean
* * * * End Original Message * * * *
I'm afraid I've forgotten some of your original question, but if it
has something to do with calling Lotus Notes API functions from
LotusScript, and if by that we mean using NotesDocument,
NotesUIDocument, et. al., then I see a lot of reason to do it. In
fact, any kind of advanced forms processing appears to be most easily
done from within Lotus Script.
I'm working on an application right now that uses @DbColumn and
@DbLookup to establish the initial values of fields, and that's a good
use for @ commands. But when it comes to multi-field validity (where
the contents of field x relies on some relationship between fields y
and z for its validity), or when you need to access an external NSF or
ODBC datasource to bring back values based on some field within this
document, then I've always found LotusScript to be easier than messing
with multi-level/nested @ commands.
Also, we access external DLLs frequently (either Windows APIs or DLLs
we've written), and I _think_ that only works within LotusScript. At
least, it's very easy to do from LS.
One final note: I also find using LS to access Notes functions to be
more natural since I came from a more traditional programming
background that included Visual Basic.
Hope this helps.
Of course you are right. I don't want to have to learn C. I was after a
string return value and assumed Evaluate would return that if
appropriate. I didn't read the small print and once I found, as you
point out that Evaluate returns a variant array, it worked fine.
Sean