Im pretty sure you dont have to, if you define a variable in the main program its a global variable which means it would be used throughout all subprograms, although i think you have to send the variable into the subprogram as a parameter. My mem is a bit dodgy so check ur text on parameters and flowcharts