Modifytemplate function – Multichannel Systems NeuroExplorer User Manual

Page 209

Advertising
background image

5.5.6.5. ModifyTemplate Function

ModifyTemplate Function


Modifies one of the template parameters.

Syntax


ModifyTemplate(doc, templateName, paramName, newParValue)

Parameters

Parameter

Type

Description

doc

documentReference Reference to the document.

templateName

string

The name of the template.

paramName

string

The name of the parameter to be modified.

newParValue

string

The new value of the parameter (as a string).

Returns


None

Comments


None

Usage

NexScript


To set the new bin value in the Rate Histograms template, you need to write:

ModifyTemplate(doc, "Rate Histograms", "Bin (sec)", "5.0")


Note that parameter name should be specified exactly as it is shown in the left column of the
Properties Panel (e.g. not "Bin", but "Bin (sec)" as in the example above). You can select the
parameter name in the left column of Properties Panel and press Ctrl+C to copy the parameter name
to the clipboard and then paste the name of the parameter into your script.


If you need to use a numeric value as newparvalue, you need to convert it to string using NumToStr
function. For example, if you need to set Select Data From = doc.Start[1]:

ModifyTemplate(doc, "Peri", "Select Data From (sec)", NumToStr(doc.Start[1]))


ModifyTemplate can be used to specify multiple references in Perievent Histograms,
Crosscorrelograms and Perievent Rasters by using "+":

doc = GetActiveDocument()

ModifyTemplate(doc, "Peri", "Ref. type", "Table (row)")

ModifyTemplate(doc, "Peri", "Reference", "Event04+Event05+Event06")

ApplyTemplate(doc, "Peri")


You can also use "+" to specify multiple interval filters in Perievent Histograms, Crosscorrelograms
and Perievent Rasters.



ModifyTemplate can be used to specify graphics parameters. To change the Graph parameter, you
need to add Graph| before the parameter name:

doc = GetActiveDocument()

ModifyTemplate(doc, "Peri", "Graph|Graph Style", "Histogram")

Page 207

Advertising