This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Macro syntax error (definitely operator error)

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

Labels:

Mainframe Access
  • Verified Answer

    +1  

    Hi David, 

    This should give you Today-2 in the format which you are looking for 

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

    As for a good learning resource, the best option here you be to find an old copy of Extra! (9.4 or earlier) and Some tool to allow you to read the WinHlp32 files, in this instance the eb32.hlp file in the Program File(x86)\Attachmate\Extra\ENU or Program File(x86)\Micro Focus\Extra\ENU folder. There are some sample macros available here https://portal.microfocus.com/s/article/KM000008384?language=en_US which might prove useful. Extra! Basic dialog box handling can be pretty tricky.

    Tom

  • 0 in reply to   

    That was exactly what I needed. Thank you for the syntax correction and resource link.