Simple "For" loop


1. Get sum from 1 to 10
  1. Select "Application" tab.

  2. Type below script on the editor.

      
    clear
    
    s1 = 0
    
    for (i=1; i <=10; i++)
    {
      s1 = s1 + i
    }
    
    print "Sum is " + s1
    
      
 

  1. Click "Send to MF Application" button or press "F5" key.

  2. Executed result:




2. Periodic loop per 1 sec
  1. Type below script on the editor.

      
    clear
    
    for (i=1; i <=10; i++)
    {
      d1 = Util.Now()
      print "Current Date & Time is " + d1
    
      wait 1000  //wait 1 sec
    }
    
      


  2. Click "Send to MF Application" button or press "F5" key.

  3. Executed result: