CS Time/TNA Documents

username password

With Variables

    Often Macro Scripts used for daily or payroll shift are similar but only the values change, i.e. the shift start and end times may differ. CS Time now enables you to write macro scripts that can include variables that can be defined once they have been attached to a particular shift.

    There are Fifty (50) variables that can be used with each Payroll or Daily Shift macro, P1 to P50 for Payroll Shifts and D1 to D50 for Daily Shifts.

     

    Creating a Macro Script with Variables


    For this example we will create a simple script that can be used for daily shifts that have different starting, lunch break and shift ending times.

    1. From the Setup / Shifts dropdown menu select the Macro Script option.

      Browse Macro Scripts.jpg
       
    2. Select the Add button.

      Update Macro Scripts.jpg
       
    3. Type in the required Name and Description that will be used to identify the particular Macro Script in the appropriate text boxes. If required, you can also add a Comment.
    4. Use the Category select buttons and select the category to which the macro is to be assigned (Daily or Payroll).
    5. In the Script box, type in the actual macro script (see Appendix E for more details). The variables that are used for Daily shifts are normally numbered from D1 up to D50 and for Payroll Shifts from P1 to P50. 
      Note: The D and P variables are only effective in Daily and Payroll script, not Other scripts.

      Example:
      at after selecting shift

      D1 = Day Start Time,@T1
      D2 = Day End Time,@T1
      D3 = Lunch Start,@T1
      D4 = Lunch End,@T1
      C1 = int(D1/6000)*6000

      C2 = int(D2/6000)*6000
      C3 = int(D3/6000)*6000
      C4 = int(D4/6000)*6000

       
    6. Once the script has been defined, click on the Ok button to save the macro and to add it to the list.

    Using a Macro Script with Variables


    In this example we will use the above macro in a Daily Shift.

    1. Select the Daily Shifts option from the Setup / Shifts dropdown menu or click the Edit Daily Shifts toolbar button.

      Browse Daily Shifts.jpg
       
    2. When the Browse Daily Shifts window is displayed, select the particular Daily Shift to which the macro is to be assigned and click on the Change button (selected CS01a –Monday - Friday in the above example).

      Update Daily Shifts Details.jpg
       
    3. Use the Macro Script select button and select the required macro (D Shift in this example).


       
    4. Select each of the variables in turn and type in the value for each that is to be used for the particular shift calculations.
    5. Once defined, select OK to save the values.

     

    Permalink:  http://tinyurl.com/ozdrgd3

    Page last modified 08:10, 20 Jul 2016 by Admin CS Time/TNA Documents > Macro Scripts > Examples > With Variables

    Comments0

    You must login to post a comment.
    Attach file

    Files4

    Powered by MindTouch Core