Programming with Reflection

image\rwnprg32.gif GenerateDeviceNames property

 

Syntax

object.GenerateDeviceNames
object.GenerateDeviceNames = Value

Data type

Boolean

 

Description

Returns (first syntax line) or specifies (second syntax line) whether Reflection automatically generates device name values based on values you specify for the DeviceName property. GenerateDeviceNames is only available for 5250 Telnet sessions.

You can include any of the following characters as part of the value you specifiy for DeviceName:

Character

How this character is used

*

Replaced by "A", "B", "C", and so on for each new session. If the entire alphabet is used, the generated device names continue with "AA", "AB", "AC", and so on.

%

Replaced by "P" for printer sessions and "S" for display sessions.

=

Replaced by "1", "2", "3", and so on.

&COMPN

Replaced by the local workstation name. If the generated name exceeds 10 characters, the excess characters are trimmed from the left (unless + is also used). This character cannot be used with "&USERN".

&USERN

Replaced by the local user name, left-trimmed if the generated name exceeds 10 characters. If the generated name exceeds 10 characters, the excess characters are trimmed from the left (unless + is also used). This character cannot be used with "&COMPN".

+

Use this character with "&USERN" or "&COMPN" to specify trimming from the right instead of from the left. This can be placed anywhere in the string.

Note: You can use only one string literal in combination with these characters. If you use separated strings, the second string is dropped.

The following is fine because it contains a single string ("MyDevice")

 Session.DeviceName = "%MyDevice"

In this example, the second string ("Device") will be ignored when the device name is generated.

 Session.DeviceName = "%My=Device"

Examples

The following generates the device name SABC1 for a display session. If this is rejected, Reflection will try SABC2, SABC3, and so on:

 Session.GenerateDeviceName = True

 Session.DeviceName = "%ABC="

The following generates the device name S123A for the first display session, S123B for the second session, and so on:

 Session.GenerateDeviceName = True

 Session.DeviceName = "%123*"

The following generates puternameA, puternameB, puternameC for the first three sessions when the computer name is "Computername":

 Session.GenerateDeviceName = True

 Session.DeviceName = "&COMPN*"

The following generates josephsmiA, josephsmiB, josephsmiC for the first three sessions when the computer user name is "josephsmith":

 Session.GenerateDeviceName = True

 Session.DeviceName = "+&USERN*"

Values

The default value is False.

 

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this property