Deletevar function – Multichannel Systems NeuroExplorer User Manual

Page 173

Advertising
background image

5.5.3.5. DeleteVar Function

DeleteVar Function


Deletes the specified variable from the file.

Syntax


DeleteVar(doc, number, varType)

Parameters

Parameter

Type

Description

doc

documentReference Reference to the document.

number

double

1-based variable number within the group specified
by varType.

varType

string

Variable type. Should be "neuron", "neuronorevent" ,
"event", "interval" "wave", "popvector", "continuous",
"marker" or "all".

Returns


None

Comments


All the analysis windows are closed before executing this function. Please note that this function
produces an immediate result - after the execution of this function, the number of variables of the
specified type is reduced by 1. Thererefore, you cannot use a simple for loop to delete all the
variables of a certain type. You can use while loop as shown in the example script below.

Usage

NexScript

doc = GetActiveDocument()

% delete the first continuous variable

DeleteVar(doc, 1, "continuous")

% delete all waveform variables

% note that we always delete the first variable

while GetVarCount(doc, "wave") > 0

DeleteVar(doc, 1, "wave")

end

See Also

Introduction to NexScript Programming

NexScript Function Categories

Page 171

Advertising