Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lotus Script & LSX

15 views
Skip to first unread message

Mark

unread,
Jul 25, 1997, 3:00:00 AM7/25/97
to

I am attempting to write LSX code to add some user defined classes, to
be used/called from Lotus Script. Does anyone have any example code of
calling a user class with some parameters including Notes classes, for
example a Notes Document.
I have written LSX code to handle int's long's and strings but not
anything more complex.

For example :
Class Test
Method MyMethod(Integer, String, NotesDocument)

In Script :
Dim myTest as New Test()
Dim ws As New NotesUiWorkspace
Dim uidoc As NotesUiDocument
Set uidoc = ws.CurrentDocument
'Copy Field contents into local variables
intprop = Cint(uidoc.FieldGetText("intval"))
strprop = uidoc.FieldGetText("stringval")

retval = myTest.MyMethod(intprop, strprop, uidoc)

And in LSX :

PLSVALUE pVal1 = &args->pArg[1];
PLSVALUE pVal2 = &args->pArg[2];
PLSVALUE pVal3 = &args->pArg[3];

// Check all passed args are ByRef
assert((pVal1->Type & LSVT_BYREF) == LSVT_BYREF);
assert((pVal2->Type & LSVT_BYREF) == LSVT_BYREF);
assert((pVal3->Type & LSVT_BYREF) == LSVT_BYREF);

// Check the passed ByRef data types
assert((pVal1->Type & LSVT_SHORT) == LSVT_SHORT);
assert((pVal2->Type & LSVT_STRING) == LSVT_STRING);

// Assign passed data to class properties
this->m_MyInteger = pVal1->vByRef->vShort;

// Strings are proprietry format so call LSI routine
// Check and delete any existing strings first!
if (this->m_MyString)
delete[] this->m_MyString;

// Get length of new string
len = LSICALL(StringLength)(pVal1->vByRef->vString);

// Allocate new space for string and copy it in
this->m_MyString = ::new LSUNICHAR[++len];
memcpy(this->m_MyString, pVal3->vByRef->vString,
sizeof(LSUNICHAR)*len);

// Get/Read items from the passed notes doc, arg3????????

// How do I refer to it? Is it LSVT_CLIENTHDL


Any help would be appreciated. Thankyou.
Mark

Mark Paveley

unread,
Jul 25, 1997, 3:00:00 AM7/25/97
to
0 new messages