package require ::quartus::project
package require ::quartus::flow
set project_name  [lindex $quartus(args) 0]
if { [ project_exists top ] } {
   project_open top -force
   if { [ catch { execute_flow -compile } result ] } {
        puts " TCL:ERROR : Compiling project $project_name"
        return $result
   } else {
        puts " --------------------------------------------------"
        puts " --                                                "
        puts " --   $project_name compiles successfully "
        puts " --   return 0"
        puts " --                                                "
        puts " --------------------------------------------------"
        return 0
   }
} else {
 puts "unable to open project $project_name"
}

