Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
List.HasValue
Checks whether a list contains a given value.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| List | 6.4 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| List | The list to process. | "Hello" ¶ "" ¶ "World" |
| Value | The value to check. | "Hello" |
Result
Returns 1, 0 or error.
Description
Checks whether a list contains a given value.Returns 1 if value is found or 0 if not. Text comparison is case sensitive.
Examples
Check if value is in list:
MBS( "List.HasValue"; "1¶2¶3"; "2" )
Print what user selected:
# Show dialog to select something
Set Variable [$r; Value:MBS("ListDialog.ClearList")]
Set Variable [$r; Value:MBS("ListDialog.SetPrompt"; "Please select items to print:")]
# We use tags as the visible titles may be localized.
Set Variable [$r; Value:MBS("ListDialog.AddItemToList"; "Werbung¶Angebot¶Rechnung¶Erinnerung"; "Flyer¶Offer¶Invoice¶Reminder")]
Set Variable [$r; Value:MBS("ListDialog.SetAllowMultipleSelection"; 1)]
Set Variable [$r; Value:MBS("ListDialog.SetSelectedTitle"; "Offer")]
# Show dialog
Set Variable [$r; Value:MBS("ListDialog.ShowDialog")]
# now do things
Set Variable [$selected; Value:MBS("ListDialog.GetSelectedTag")]
If [MBS("List.HasValue"; $selected; "Flyer")]
# print flyer
End If
If [MBS("List.HasValue"; $selected; "Invoice")]
# print invoice
End If
If [MBS("List.HasValue"; $selected; "Offer")]
# print offer
End If
If [MBS("List.HasValue"; $selected; "Reminder")]
# print reminder
End If
See also
- List.AddValue
- List.GetValue
- ListDialog.AddItemToList
- ListDialog.ClearList
- ListDialog.GetSelectedTag
- ListDialog.SetAllowMultipleSelection
- ListDialog.SetPrompt
- ListDialog.SetSelectedTitle
- ListDialog.ShowDialog
- QuickList.HasValue
Blog Entries
Created 16th September 2016, last changed 16th September 2016
List.HasDuplicateItems - List.IndexOfFirstValueMatching
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos