<< Click to Display Table of Contents >> Navigation: Macros > Macro commands and parameters > Macro reporting commands |
There are four ways to report data from within a macro:
•Write to an object in the one-line editor
•Write to a text
•Write to a text file
•Write to an Excel workbook
Write to an object in the one-line editor
Macro resulting text can be printed next to each object in the one-line network diagram. Also the colour of each object can be changed. See:
•View
Write to a text
Besides reporting to a file it is also possible to output to a text on screen. See:
•Text: write a value as line to a text
•Debug: write a value as line to a text, in a separate window
Write to a text file
A reporting command is used to print the results of a calculation to a text file. The file has to be opened and a separator has to be defined. Data can be written to one line or to multiple lines of text. Afterwards the file has to be closed. An opened file can not be read at the same time. See:
•TfOpenForWrite: Open a text file for writing
•TfWrite: Write to one line of a text file
•TfWriteLn: Write to one line of a text file and include a linefeed
•TfClose: Close a text file
Write to an Excel workbook
A reporting command is used to print the results of a calculation in the form of an Excel workbook (spreadsheet). Using the commands, one can increase the number of sheets in the workbook and assign a title to each sheet. The workbook can be formatted by using a command to have the content of a particular cell printed in bold type. It is also possible to have the width of a column adjusted to accommodate its content. Read and write operations may be executed in the same session. See:
•Create: create a new spreadsheet
•Open: opening an existing spreadsheet
•Close: closing a spreadsheet
•Addsheets: expands the number of worksheets in aan Excel workbook
•Getsheets: retrieve the number of worksheets in aan Excel workbook
•Title: definition of a name for a worksheet in the workbook. The worksheet can be accessed by the number only
•GetTitle: retrieve the name of a worksheet in the workbook
•Write: write a value in a cel of a worksheet into the workbook
•Copy: to copy a range of cells of a worksheet into a worksheet of the output workbook
•Bold: boldface the contents of a range of cells in the worksheet
•Border: create a border around the contents of a range of cells in the worksheet
•Merge: merge a range of cells in the worksheet
•Fit: to fit the column width to the contents of a range of cells in the worksheet
•Align: to align the text of a range of cells in the worksheet horizontally and vertically
•Fontcolor: to colour a range of cells in a spreadsheet
•Backcolor: to colour the background of a range of cells in a spreadsheet
•Format: to format the presentation of a number or a text value
See also:
•Alteration: changing the network or variables
•Arithmetic functions: functions for rounding, square, logarithm an goniometry
•Procedures: user defined procedures
•Conditional actions: executing or skipping parts of a macro, depending on a value
•Loops: repeatedly executing or skipping parts of a macro, depending on a value
•Calculation: determining results
•Input: reading from spreadsheets for a macro execution
•Network actions: saving networks modified by the macro
Back to Commands and Parameters.