Example

The following example shows you how to define a screen variable and use it to execute specific actions based on a variable returned by PROFS.

This is a long example, which contains examples of creating several different kinds of macro commands. If you are unfamiliar with macros, we recommend that you create the macro contained in the example to familiarize yourself with the macro editor and macro command syntax.

  1. Select Tools > New Macro > RMC.
  2. In the Macro Name field, type Flow Example.
  3. Right-click in the macro display area, and choose Variable Setup from the pop-up menu to open the Variable Setup dialog box.
  4. Select Variable for screen text from the Variables list.
  5. Select Screen Variable from the Variable Types list.
  6. Click the Screen Variable tab.

    GUID-6FE45772-DA32-468E-B7D3-E0CC991D6C57-low.bmp

  7. Change the Get text from Column value to 78.
  8. In the Get how much text? frame, select This many characters, and type 3 in the box.
  9. Click OK to save the settings.

    This gets 3 characters from the screen at row 1, column 78 and saves them as a variable that your macro can use.

  10. Open the Goto Label dialog box.

    GUID-C3309D4C-7BAB-4B3B-B60C-D2E3AA96ECFB-low.bmp

  11. Select Variable for screen text from the list, then click OK.
  12. Open the Message dialog box. Type Screen Unknown and click OK.
  13. Open the Goto Label dialog box. Type Macro End and click OK.
  14. Open the Label dialog box. Type A00 and click OK.
  15. Open the Message dialog box. Type PROFS Main Screen and click OK.
  16. Open the Receive dialog box.
    1. Type Mail Waiting in the Find text box.
    2. Under Screen Position, select Only at row, column, and type 24 and 69 in the Row and Column boxes.
    3. In the Timeout frame, select Seconds, and type 30 in the box.
    4. In the Otherwise box, type NoMail.
    5. Click OK.
  17. Open the Message dialog box. Type You have mail and click OK.
  18. Open the Label dialog box. Type NoMail and click OK.
  19. Open the Goto Label dialog box. Type Macro End and click OK.
  20. Open the Label dialog box. Type C00 and click OK.
  21. Open the Message dialog box. Type You are on the Open Mail Screen and click OK.
  22. Open the Goto Label dialog box. Type Macro End and click OK.
  23. Open the Label dialog box. Type E01 and click OK.
  24. Open the Message dialog box. Type You are reading a message and click OK.
  25. Open the Label dialog box. Type Macro End and click OK.
  26. Add Exit Macro to end of macro.
  27. Select File > Save, then close the Macro Editor.

Your completed macro should look like this:

GUID-7740F11A-DFDC-4CA8-AC55-8399859074D5-low.jpg

This macro looks at the current PROFS screen and returns a message box containing a description of what was found. You can use this macro as a model to test different macro functions.