A question about functions using void

Dear all

I have a question about functions in FreeFEM. Is it possible to use “void” type functions in FreeFEM?

Because my FreeFEM scripts have become long, I want to modulize my codes for maintenance.

But, when I looked at official FreeFEM documents, it seemed that there is no way to use the void type function.

So, if the void type function can not be used in FreeFem, how do you modulize your code?

Thank you

Sincerely

What do you mean by modulize? How being able to use the type void would do a better job than what you have access to now?

Hi. So, in my code, there is a “for” loop to solve time-dependent differential equations.

In the for loop, there are more than 50 lines for different commands. Due to the long lines, it seemed messy when I checked my code.

So, I want to call these commands or functions in the below way;

For instance, if it is written like C++ or C,

for (int i = 1; i < iteration; i++){
    function1();
    function2();
    function3();
}
...
void function1(void){
     <command lines>
}
void function2(void){
     <command lines>
}

But, I am not sure how I can do this in FreeFEM code

Thanks

I think you can achieve what you want by using macros. Check the documentation for more info.

Thanks a lot! It would work!