Previous Page Next Page Contents

generate::Macrofort::setAutoComment -- automatic comments

Introduction

Mac::setAutoComment (where Mac:=generate::Macrofort) is a switch to ensure that FORTRAN code generated by Mac::genFor includes FORTRAN comments.

Call(s)

generate::Macrofort::setAutoComment(b)

Parameters

b - TRUE or FALSE.

Returns

the void object of domain type DOM_NULL

Side Effects

Resets the internal macrofort variable for the FORTRAN code generated by generate::Macrofort::genFor.

Related Functions

generate::Macrofort::init, generate::Macrofort::genFor

Details

Example 1

>> Mac:=generate::Macrofort:
   Mac::init():

Note that the default mode for the automatic comments set by Mac::init is TRUE (meaning on).

>> Mac::openOutputFile("test.f"):
   Mac::genFor(["subroutinem", foo, [a, b, i],
                [["equal", a, 1], ["equal", b, 2]]]):
   Mac::closeOutputFile():

Switch auto-comment off and send output to a different file.

>> Mac::setAutoComment(FALSE):
   Mac::openOutputFile("test2.f"):
   Mac::genFor(["subroutinem", foo, [a, b, i],
                [["equal", a, 1], ["equal", b, 2]]]):
   Mac::closeOutputFile();

The output file with comments test.f is:

      c      
      c     SUBROUTINE foo
      c      
            subroutine foo(a,b,i)
              a = 1
              b = 2
            end

The output file without comments test2.f is:

            subroutine foo(a,b,i)
              a = 1
              b = 2
            end



Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000