Home

Results 1 to 3 of 3

Thread: Want to set CAPLOCK and NUMLOCK via Macro

Threaded View

  1. #1
    Join Date
    May 2017
    Location
    Kentucky
    Posts
    29

    Want to set CAPLOCK and NUMLOCK via Macro

    We are using the new version on MICRO FOCUS Reflection (v16). In the older version of Reflection (v14) I was able to code setting NUMLOCK and CAPLOCK via a macro command.

    OLD VERSION CODE (LEGACY PROJECT)
    Code:
     Sub ACCESSION_ORDERS()
    ' Generated by the Reflection Macro Recorder on 08-16-2013 07:55:22.98.
    ' Generated by Reflection for UNIX and OpenVMS 14.0.6.
    ' BUTCH JONES 8/16/2013
    
        On Error GoTo ErrorHandler
    
        Const NEVER_TIME_OUT = 0
    
        Dim LF As String    ' Chr(rcLF) = Chr(10) = Control-J
        Dim CR As String    ' Chr(rcCR) = Chr(13) = Control-M
    
        LF = Chr(Reflection2.ControlCodes.rcLF)
        CR = Chr(Reflection2.ControlCodes.rcCR)
    
        With Session
     
            Session.CapsLock = True
            Session.NumLock = True
       
        
            .MsgBox "You are a pretty baby"
                   
        End With
        
        Exit Sub
    
    ErrorHandler:
        Session.MsgBox Err.Description, vbExclamation + vbOKOnly
    
        ' Recording stopped at 07:55:41.87.
    End Sub
    The new version will not allow this code sequence to work. I have also tried coding this in the current project, NOT LEGACY..

    NEW VERSION CODE

    Code:
    Sub caplock()
    
    ' Generated by the Reflection Macro Recorder on 06-29-2017 11:40:43.11.
    ' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).
    
    Dim osCurrentScreen As Screen
    Dim osCurrentTerminal As Terminal
    Dim returnValue As Integer
    
    Const NEVER_TIME_OUT = 0
    
    Dim LF As String    ' Chr(rcLF) = Chr(10) = Control-J
    Dim CR As String    ' Chr(rcCR) = Chr(13) = Control-M
    
    Set osCurrentTerminal = ThisFrame.SelectedView.control
    Set osCurrentScreen = osCurrentTerminal.Screen
    
    LF = Chr(10)
    CR = Chr(13)
    
        ThisScreen.CapsLock = True
        ThisScreen.NumLock = True
        
    Exit Sub
    
    ' Recording stopped at 11:40:49.72.
    
    End Sub

    Nothing seems to work. Anyone have an idea that they can suggest?

    Thanks,
    Butch Jones
    Last edited by marshallgrads; 29-Jun-2017 at 05:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •