ListExists

Top  Previous  Next

×V4.0Ø

S

A

W

WS

ü

ü

Syntax -

If ListExists <ListName>

 

Description:

This command is used inside of an IF statement to determine if the List specified exists.  This command is useful in discovery of existing lists, which will help eliminate errors/extra code relating to:

Trying to create a list that already exists which will result in an error.
Using a variable to set a flag that list exists is extra code that is no longer needed.
Disposing and re-creating a list is extra code than can potentially lose needed info from original list.

 

Note: This command was introduced in EMUE V4 and will not work with previous versions.

 

Sample 1:

       The following IF statement will look for the existence of a List named "Name_Of_List", if found it will proceed with the rest of the script, if not found it will go into debug mode.

If ListExists Name_Of_List Then

       LogLine "List found, it does exist.  Proceeding to ListFound"

       Call ListFound

Else

       LogLine "List not found, it does not exist.  Please advise."

       Debug

EndIf

 

Sample 2:

The following IF statement will look for the existence of a List named "Name_Of_List", if found it will GoTo Label ListFound then proceed with the rest of the script, if not found it will go onto the next line of code.

If ListExists Name_Of_List GoTo ListFound

 

Sample 3:

The following IF statement will look for the existence of a List named "Name_Of_List", if found it will GoTo Label ListFound then proceed with the rest of the script, if not found it will go onto the next line of code.

If ListExists Name_Of_List Then

       If EndOfList Name_Of_List Then

               GetListCount Count_In_List

       Else        

               GoTo

       EndIf

Esle

 

EndIf

 

 

See Also:

CreateList

DisposeList

FindListPosition

GetListCount

GetListMember

GetListPosition

PutListMember

SetListPosition

Complex If Comparisons