Find - FormList

From the CreationKit Wiki
Jump to navigation Jump to search

Member of: FormList Script

Finds the specified form in the form list and returns its index or returns -1 if it's not a member.

Syntax[edit | edit source]

Int Function Find(Form apForm) Native

Parameters[edit | edit source]

  • apForm: The form whose index is to be returned.

Return Value[edit | edit source]

  • apForm's index as an Int.

Examples[edit | edit source]

Int iIndex = PotionFLST.Find(WhiteRussianALCH)
If iIndex == - 1
	Debug.Trace("WhiteRussianALCH is not a member of the PotionFLST.")
Else
	Debug.Trace("WhiteRussianALCH is a member of the PotionFLST and its index is " + iIndex + ".")
EndIf

Notes[edit | edit source]

  • Using Find as a condition for an IF check will still return as TRUE if the value returns -1 for not having the form on the formlist. The IF check will require a != -1 in order to fail the check ex:    if MyFormList.Find(MyForm) != -1

See Also[edit | edit source]