WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Context

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

n4SetContext Example

Keywords:    n4SetContext

Question:

Do you have an example on how to use the new n4SetContext function?

Answer:


AddExtender("wwn4x34I.dll")


;message(n4GetContext(1),n4GetContext(0))

debug(1)

n4SetContext("Org","Trees")
n4logout()

n4SetContext("Org","Trees")
n4Login("CN=autonc", "ncpass", "O=org", "Trees")
n4Attach("\\birch")
n4Map("\\birch\SYS\data\apps\nc_data", "m:")

n4SetContext("Org","Tree00")
n4Login("CN=autonc", "ncpass", "O=org", "Tree00")
n4Attach("\\spruce")
n4Map("\\spruce\sys\data\nc_data", "n:")

n4MapDelete("n:")
n4SetContext("Org","Tree00")
n4Detach("\\spruce")
n4LogoutTree("CN=org", "tree00")

n4MapDelete("m:")
n4SetContext("Org","Trees")
n4Detach("\\birch")
n4LogoutTree("CN=org", "trees")

exit

;n4NameConvert("org", "birch", 1)

;n4GetContext(0)	      ;0=context, 1=tree
;n4GetContext(1)	      ;0=context, 1=tree
;n4SetContext(context,tree)

Question:

With the following code, I run pconsole.exe, and then use n4SetContext to set the context:
Run ("Pconsole.exe", "")
WinWaitClose (temoin)
n4SetContext (ContextCourant,"")
I verify if the new context is ok, and it's ok. But the pconsole program doesn't have the right context (the new one).

Answer:

The n4SetContext function only sets the context for other n4 functions. When you RUN pconsole it uses the system default context and ignores the n4Context.

Maybe pconsole has a command line parameter to set context ???


Article ID:   W13625
Filename:   n4SetContext.txt
File Created: 2001:03:01:13:49:44
Last Updated: 2001:03:01:13:49:44