chavez
11th April 2008, 21:23
Does anyone know how to invoke a session (zoom.to$, start.session, activate) with a given index?
Thank you

NPRao
11th April 2008, 23:04
Your profile says Baan-4c4 while the thread info refers to LN-6.1

You can use the tools functions - to.key() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_db_operations_to_key)

Sample code:

before.program:
import("prog.name$", calling.session)
curr.comp = get.compnr()
string calling.session(15)
calling.session = trim$(calling.session)
if calling.session = "zmmig2100m000" or
calling.session = "zmmig2600m000" then
to.key(2)
else
to.key(1)
endif

günther
14th April 2008, 09:26
Another way (more customizing) is to copy and rename just the session and to set the index as needed. For example, a standard session ...m000 works on index 1, so copy could create a ...m001 working on index 2.

Günther

chavez
14th April 2008, 13:50
Thank you both.
Because in LN it's possible to define the index when calling a session in the zoom to folder i was thinking about some system variable to control this.
The to.key does the job perfectly.
About my profile I started with Baan IV and I'm now starting with LN.
I'll change my profile.
Regards