RMS Add-Ins: managing state using session variables

Hi,

I'm new to the world of RMS, but have been looking into making RMS Add- Ins. I'm developing in C#.

I've got a couple of add-ins written that don't do anything particular at the moment, but do need a way of passing state to each other.

The two add-ins are hooked into the InitializeTransaction and PrintReceipt hooks. At the moment, I'm passing state around by using a session variable.

However, what I find a little odd is that the session variables appear to be implemented as a fixed 10-position array. For my initial testing I'm just arbitrarily picking one slot in the array to use. And it works a treat.

But, in a real-world deployment, I can't hard-code a slot to use. So, should I just loop through all 10 slots, looking for the first free one (if setting the variable) or one that conforms to a particular type (if retrieving the variable)? But what happens if all 10 slots are in use by other add-ins?

The only other options I can see are to either customize the database and manage state through there, or to have something like a .NET Remoting singleton to manage all the state. But those both seem like using a sledgehammer to crack a nut.

Please, someone tell me I've completely misunderstood how the session variables work, and set me straight...

Cheers Ian

Reply to
Ian
Loading thread data ...

yea i tried that, but it can be done only at dll and works but at the receipt side well .....

Public hookx(10) As String hookx(1) = "ESTE" hookx(2) = "CASO PERDIDO" hookx(3) = "ESTA" hookx(4) = "CASI RESUELTO?" identity.Variable(10) = hookx

MsgBox("El Registro Actualizado es " & identity.Variable(10)(1).ToString & ".")

Reply to
YUSHA

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.