StartSubName: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
JefD (talk | contribs)
New page: {{Description|description=This command begins the Sub Name mode. This command will clear the current output line, then redirect all subsequent output into a SubName buffer. After [[EndSubN...
 
Danm (talk | contribs)
Added code sample and additional clarification.
Line 1: Line 1:
{{Description|description=This command begins the Sub Name mode. This command will clear the current output line, then redirect all subsequent output into a SubName buffer. After [[EndSubName]] is called, the contents of the sub name buffer will be used as the file name for the next sub created with a call to [[OpenSub]].}}
{{Description|description=This command begins the Sub Name mode. This command will clear the current output line, then redirect all subsequent output into a SubName buffer. After [[EndSubName]] is called, the contents of the sub name buffer will be used as the file name for the next sub created with a call to [[OpenSub]].}}
An [[EOL]] must be used to end the filename line.
The standard use of this command is to allow each sub to reside in it's own text file, and to allow the post developer to name the output files according to the needs of the control.
=Code Sample:=
This code shows the use of StartSubName and [[EndSubName]], along with [[IncVar]] and [[GetVar#]] to set up a counter.
<nowiki>IncVar('SubCounter')
StartSubName
'MySubFilename' GetVar#('SubCounter') '.NCF' EOL
EndSubName
OpenSub</nowiki>
{{Stats|id=560|type=Command|class=All Machines|scope= Global|version=6.0}}
{{Stats|id=560|type=Command|class=All Machines|scope= Global|version=6.0}}
[[Category:MTM]]
[[Category:MTM]]

Revision as of 23:08, 13 February 2013

Description

This command begins the Sub Name mode. This command will clear the current output line, then redirect all subsequent output into a SubName buffer. After EndSubName is called, the contents of the sub name buffer will be used as the file name for the next sub created with a call to OpenSub.

An EOL must be used to end the filename line. The standard use of this command is to allow each sub to reside in it's own text file, and to allow the post developer to name the output files according to the needs of the control.

Code Sample:

This code shows the use of StartSubName and EndSubName, along with IncVar and GetVar# to set up a counter.

IncVar('SubCounter')
StartSubName
	'MySubFilename' GetVar#('SubCounter') '.NCF' EOL
EndSubName
OpenSub

Stats

ID 560
Type Command
Class All Machines
Scope Global
Min Version 6.0