Babar logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
Workbook Home Introduction Account Setup QuickTour Packages Modules Unwrap page!
Event Information Tcl Commands Editing Compile and Link Run the Job Debugging
Check this page with the
W3C Validator
(More checks...)
Parameters Tcl Files Find Data Batch Analysis ROOT Tutorial

Example of Nested Code

void Function1(){ //begin function body
 //code for Function1 indented one level
 double time;  //time on stack
 statement one;
 statement two;

 if (condition) {//begin if body
   //code for if statement indented two levels
   bool test;  //test on stack
   then execute this code;
   while (condition){ //begin while body
     //code for while statement indented three levels
     int x;  //x on stack
     and so forth;
   }//innermost closes first, end while body, x out of scope
   another statement; //part of if statement body 
   onemore statement;
 }//second innermost, end if body, test out of scope
 //more Function1 statements would go here

}//outermost last, Function1 body, time out of scope

Back to C++ section