Jump to content
Guest barry

ListGet ( InList; InNum )

Recommended Posts

Guest barry

Get the value from the list, specified by InNum - Submitted by Richard DeShong

 

 

[TABLE]

[TR]

[TD]Sample Input:

[TABLE=width: 100%]

[TR]

[TD=bgcolor: #FFFFFF]ListGet ( "A¶B¶C" , 2 )[/TD]

[/TR]

[/TABLE]

[/TD]

[TD=width: 50%]Sample Output:

[TABLE=width: 100%]

[TR]

[TD=bgcolor: #FFFFFF]"B"[/TD]

[/TR]

[/TABLE]

[/TD]

[/TR]

[/TABLE]

Let( V = GetValue ( InList; InNum ); Case ( IsEmpty ( V ); "Empty"; V ) ) // Get the specified (InNum) value of InList. If no value, return "Empty" string.

 

 

Simple replacement for GetValue(), with a twist. The names of all of my "work with list" functions start with "List" - this makes them easier to remember.

 

The twist is that this function is almost always used to set a variable. When I set a variable in my script, I do not want it released, so I always want it to have some value. Thus the inclusion of the Case() and return of the string "Empty".

 

In my code, I can then test: $SomeVar = "Empty".

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

Terms of Use