Search code examples
macrosattachmate-extraattachmate-reflection

Macro syntax failure in attachmate extra


I've been scrubbing google to find a quick reference for macro coding in Attachmate extra! unsuccessfully. Could someone point me to a URL to learn what I need to know, tell me how to resolve the code below or both.

I took a "Hello World" example and a recorded macro and mushed the below code together, which does what i need with a couple exceptions.

Dim dlgHello as HelloDialog 'Declare the dialog file.

nRet = Dialog (dlgHello)
Select Case nRet 'dlgHello.AllButtons
    Case - 1        ' OKButton
        Sess0. Screen. Sendkeys ("Show a60:4aug;a")
        Sess0. Screen. Sendkeys("<Enter>")
        Sess0. Screen.WaitHostQuiet (g HostSettleTime)
        System. Timeoutvalue = OldsystemTimeout
        Msabox "Done"
    Case 0 ' CancelButton
        Msgbox  "Goodbye! "
End Select

While this code above works, I need to change it to pull system date and subtract two days.

Original code Sess0. Screen. Sendkeys ("Show a60:4aug;a")

Instead of the static 4aug, I need the code to pull the system date then subtract two days.

My failed attempt was Sess0. Screen. Sendkeys ("Show a60:"Today() -2"a")

Would be grateful if anyone could tell me how to resolve this and also point me to a good learning resource. Thanks


Solution

  • I received a working solution from Tom F in the MicroFocus community. Solution below.

    Sub Main
        Dim myDate
        myDate=CVar(Date)-2
        myDate = Format(myDate, "dmmm")
    End Sub 
    

    https://portal.microfocus.com/s/article/KM000008384?language=en_US