Armando_Rod2000
26th September 2002, 15:45
Hi.

I have some problems:

I´ve two main sesions that are calling a secundary sesion. How i can to know from secundary session which main session call it?. There is a variable as prog.name$ that give me the main sesion name from the secundary session?

if you can help me. .... thanks :confused:

dbinderbr
26th September 2002, 16:15
Hi !

How are you calling the secondary session? Probably you're using the function zoom.to$.

The zoom.to has a parameter that identifies the calling session.

zoom.to$ sintax:
string zoom.to$( string process(14), long zoomcode, string zoomname(18), string returnfld(18), long formpos )

How to use (just an example of usage):

In the primary session:

choice.user.0:
on.choice:
zoom.to$("tiitm1501s000", Z.SESSION, "tiitm1101", "", 0)


In the secondary session:

zoom.from.tiitm1101:
on.entry:
do.something.when.called.by.tiitm1101()
on.exit:
....

zoom.from.tiitm1102: |# Any other session that calls this one
on.entry:
do.something()
on.exit:
...


Another solution is the use of the function import in the secondary session.

Example:

In the primary session:


|#in the declaration section
extern string session.name(14) |# Must be extern and global

|#somewhere in your script...
session.name = prog.name$


In the secondary session:

|#create the same variable
extern string session.name(14)

before.program:
import("session.name", session.name)

|# or

zoom.from.all:
on.entry:
import("session.name", session.name)

|# now the variable session.name is available to do anything you want

Armando_Rod2000
26th September 2002, 16:24
Ok i knew it but ...... is there a predefinited variable that resume all it? So thanks very much. :)

jaapzwaan
26th September 2002, 16:29
This is easier:

Only edit the secondary session:



|#create a variable (no need to be extern)
string session.name(14)

before.program:
import("prog.name$", session.name)

dbinderbr
26th September 2002, 16:41
Sorry, but I am almost sure that at least in Baan IV there isnt a pre-defined variable to do that.

You'll have to write some code lines... :)

dbinderbr
26th September 2002, 16:44
jaapzwaan,

You must use [ ] instead of < > to use the tag code=baan ok !

Armando_Rod2000
26th September 2002, 17:48
i understand....
what´re you trying to say me with use [] <> dbinderbr ?

jaapzwaan
26th September 2002, 18:10
dbinderbr was helping me with the layout of my code. Thanks dbinderbr! It seems to work now. In the original posting the syntax highligts didn't work.

So this should work:


|#create a variable (no need to be extern)
string session.name(14)

before.program:
import("prog.name$", session.name)