quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Optional Argument

To allow subroutines to evolve over time without having to change all of the existing calls, Vera supports optional arguments. Optional arguments must have default values. To allow subroutines to evolve over time without having to change all of the existing calls, OpenVera supports optional arguments. Optional arguments must have default values.

   

space.gif

subroutine (type optional_arg1 = default_value,type
optional_arg2 = default_value, ...) {
  statements
}
   

space.gif

To allow subroutines to evolve over time without having to change all of the existing calls, OpenVera supports optional arguments. Optional arguments must have default values.

   

space.gif

   

space.gif

  ../images/main/4blue_dots_bullets.gif Example : Optional Argument
   

space.gif


  1 program optional_value {
  2   print(1);
  3   print(1,2);
  4   print(1,2,3);
  5 }
  6 
  7 task print (integer m, ((integer n = 100)), (integer o = 10)) {
  8   printf("Inside m           %0d\n",m);
  9   printf("Inside n           %0d\n",n);
 10   printf("Inside o           %0d\n",o);
 11 }
You could download file optional_value.vr here
   

space.gif

  ../images/main/4blue_dots_bullets.gif Simulation : Optional Argument
   

space.gif

 Inside m           1
 Inside n           100
 Inside o           10
 Inside m           1
 Inside n           100
 Inside o           2
 Inside m           1
 Inside n           2
 Inside o           3
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com