Question: splitting worksheet across multiple files

I am looking for some practical advice on how the cool kids split a Maple worksheet across multiple files. I have been reading through the help sections on procedures and modules, but most of the information is for self-contained sections of code in one file. I have come across some info in the help sections on using multiple files, but I am hoping to find out if there is a standard, recommended way of doing this.

The idea is that there will be several files, each of which contain only Maple procedures (or modules), and one master file. The master file will somehow load or include the other files, and it will somehow execute or define the procedures in the other files, which will then be available to the master file.

Ideally, there should also be some means of having "global variables" defined in the master file, which are them somehow made available to the loaded or included files, that is without the need to have long argument lists. Here is an example:

#--------  master file

restart :
fix_A := 20 :
Array_A := Array( 1 .. fix_A ) :

<load or include file here>

proc_in_subfile(  Array_A ) :

#--------  end of master file

 

#--------  subfile

proc_in_subfile := proc(  Array_A )
local i_A :

# Note: fix_A value comes from master file, not passed as argument, is this possible?
for i_A from 1 to fix_A do
  Array_A[i_A] := 1.000 :
end do :

end proc :

#--------  end of subfile

 

 

Please Wait...