new_strtok


The new_strtok function is a non-class version of the CStrTok:new method which creates and returns a new CStrTok object.

Syntax

S = new_strtok( strString, strTokens )

bullet.gif    Creates a CStrTok object S and initializes it with the target string and the tokens. You can begin calling Next to parse the target string into tokens.

bullet.gif    strString is the string to parse.

bullet.gif    strTokens specified the tokens used to parse the string.

S = new_strtok()

bullet.gif    Default constructor. The new CStrTok S is not initialized. You must call Init before parsing the string.

S = new_strtok( CStrTok2 )

bullet.gif    This is a copy constructor. The new CStrTok S is initialized to the target string and delimiters of the CStrTok instance.

bullet.gif    On success, a CStrTok object is created and returned.

bullet.gif    On failure, nil is returned.

Example

The following script creates a new CTextView and opens a Mira Text Editor window with the specified title:

T = new_strtok(str, " \t")

-- create a new CStrTok for string str and tokens space + tab

  ...

-- other uses of the class go here

T:delete()

-- deletes the object.

Related Topics

CStrTok

new

delete


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.