Module nwcOptList

A nwcItem supporting object class for option lists.

An object of this type is actually just a simple Lua list containing all of the values. Options can be retrieved from it like any other Lua list/table. You can use the standard table methods on nwcOptList objects.

Type nwcOptList

nwcOptList:Find(a)

Find an option value in the list.

nwcOptList.ID

Contains the name of the object type (nwcOptList)

nwcOptList:WriteUsing(writeFunc)

Standard output function with a user specified write function.

nwcOptList:__tostring()

Provides an automatic converting to string.

nwcOptList.new(fieldtxt)

Constructs a new nwcOptList object.

Type nwcOptList

Field(s)

nwcOptList:Find(a)

Find an option value in the list.

Parameter

  • a : The option value/text to match in the list.

Return value

#number: the index of the matching option, or false

#string nwcOptList.ID

Contains the name of the object type (nwcOptList)

nwcOptList:WriteUsing(writeFunc)

Standard output function with a user specified write function.

Parameter

  • writeFunc : The function that will be used to write the pieces that constitute the reconstructed text.

nwcOptList:__tostring()

Provides an automatic converting to string.

Return value

#string: the raw string representation of the object.

nwcOptList.new(fieldtxt)

Constructs a new nwcOptList object.

Parameter

  • #string fieldtxt : The raw option field text.

Return value

#nwcOptList: A new nwcOptList object.

Copyright © 2020 NoteWorthy Software™, Inc.
All Rights Reserved.