BBjConfig::unpinSessionEntity

Description

In BBj 7.0 and higher, this BBjConfig method unpins the specified program or resource. Loading this program or resource again causes BBj to check its timestamp and load a new version on disk, if the timestamp has changed.

Syntax

Return Value

Method

void

unpinSessionEntity(string shortName)

Parameters

Variable

Description

shortName

The name passed to CALL, RUN, LOAD, or RESOPEN.

Return Value

None.

Remarks

This method only affects the session in which it is executed.

Example

rem 'unpinSession.src:

    callProg$ = "unpinSession2.src"
    if (ARGC > 1) then GOTO CHANGE_PROGRAM FI
    CALL callProg$, A

    rem ' A should now equal 5
    PRINT "A = 5:", A
    DUMMY = SCALL("bbj " + pgm(-1) + " - 1")

    rem ' Run it again. We will not see the changes yet.
    CALL callProg$, A
    PRINT "A = 5 still:", A

    rem ' Unpin the program in the session to get the changes
    myApi! = BBjAPI()
    myConfig! = myApi!.getConfig()
    myConfig!.unpinSession()

    rem ' Run it a third time. This time we'll see the changes
    CALL callProg$, A
    PRINT "Now A = 3:", A
END

CHANGE_PROGRAM:
    rem ' Open the program file to modify it.
    OPEN(1,MODE="O_APPEND")callProg$
    WRITE(1)"B = 3"
    CLOSE(1)
release

rem 'unpinSession2.src:
    rem ' Assigning to B will assign to a in the calling program.
    ENTER B
    B = 5

See Also

BBjAPI

BBjConfig

BBj Object Syntax

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.