Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmTerminal Object / GenerateDeviceNames Property
Example
In This Topic
    GenerateDeviceNames Property (IbmTerminal)
    In This Topic
    Gets or sets a value indicating whether the terminal automatically generates device name values based on values you specify for the DeviceName property.
    Syntax
    expression.GenerateDeviceNames As Boolean
    where expression is a variable that represents a IbmTerminal Object

    Property Value

    The default value is True.
    Exceptions
    ExceptionDescription
    This exception is thrown when you modify a property that was secured via the Permissions Manager, or that can only be modified by an Administrator.
    Remarks

    GenerateDeviceNames is available only for 5250 Telnet sessions. The default value is false.

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

    Character How this value 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.
    ;ampCOMPN 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 ";ampUSERN".
    ;ampUSERN 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 ";ampCOMPN".
    + Use this character with ";ampUSERN" or ";ampCOMPN" to specify trimming from the right instead of from the left. This can be placed anywhere in the string.

    You can use only one string literal in combination with these characters. If you use separated strings, the second string is dropped.
    Example
    Setting the device name
    'The following is fine because it contains a single string ("MyDevice")
        ThisIbmTerminal.GenerateDeviceName = True     
        ThisIbmTerminal.DeviceName = "%MyDevice"
    'In this example, the second string ("Device") will be ignored when the device name is generated.
        ThisIbmTerminal.GenerateDeviceName = True     
        ThisIbmTerminal.DeviceName = "%My=Device"
    'The following generates the device name SABC1 for a display session. If this is rejected, Reflection will try SABC2, SABC3, and so on: 
        ThisIbmTerminal.GenerateDeviceName = True 
        ThisIbmTerminal.DeviceName = "%ABC=" 
    'The following generates the device name S123A for the first display session, S123B for the second session, and so on:
        ThisIbmTerminal.GenerateDeviceName = True 
        ThisIbmTerminal.DeviceName =  "%123*" 
    'The following generates puternameA, puternameB, puternameC for the first three sessions when the computer name is "Computername":
        ThisIbmTerminal.GenerateDeviceName = True 
        ThisIbmTerminal.DeviceName = ";ampCOMPN*"
    'The following generates jacksmiA, jacksmiB, jacksmiC for the first three sessions when the computer user name is "jacksmith":
        ThisIbmTerminal.GenerateDeviceName = True 
        ThisIbmTerminal.DeviceName = "+;ampUSERN*"
    See Also