Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Functions/bobspadger/ListValues.fmfn
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
ListValues ( Field )
2011.06.28, Koji Takeuchi <takeuchi@nemoux.com>


description:
Return return separated value of Field data in current found set.
ex.
nameLast = "Shin" on record 1, "Koji" on record 2, "Kazuhiko" on record 3, "" on Record 4, "Satsuki" on record 5, "Kaori" on record 6

ListValues ( nameFirst )
-> "Shin¶Koji¶Kazuhiko¶¶Satsuki¶Kaori"
http://www.briandunning.com/cf/1323
*/

Let (
[
$$ListValues_total_count =
Case ( IsEmpty ( $$ListValues_total_count ) ; Get ( FoundCount ) ; $$ListValues_total_count ) ;
$$ListValues_current_count =
Case ( IsEmpty ( $$ListValues_current_count ) ; 1 ; $$ListValues_current_count + 1 ) ;
$$ListValues_value =
Case ( $$ListValues_current_count > 1 ; $$ListValues_value & "¶" ) &
GetNthRecord ( Field ; $$ListValues_current_count )
] ;

Case (
// If $$ListValues_current_count is not reach to $$ListValues_total_count, call this function recursively.
$$ListValues_current_count < $$ListValues_total_count ;
ListValues ( Field ) ;

// Otherwise, clean up $$variable and return result.
Let (
[
result = $$ListValues_value ;
$$ListValues_total_count = "" ;
$$ListValues_current_count = "" ;
$$ListValues_value = ""
] ;
result
) // Let
) // Case

) // Let
36 changes: 36 additions & 0 deletions Functions/bobspadger/compareLists.fmfn
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* compareLists ( allowedList ; selectedList )
*
* PURPOSE:
* Compare the contents of a list against a second list of accepted values (example listA contains 1 2 4 which are allowed values , listB contains 2 3 4 - this will result in nomatch as 3 is not allowed as per listA)
*
*
* PARAMETERS:
* allowedList - a list of values
* selectedList - a list of values
*
* RETURNS:
* match = values in selectedList are permissible
* nomatch = value(s) in selectedList are not permissible
*
* NOTES:
*
* designed to compare magento Store ID's for products - ie , is the product in listA allowed by the possible store views
*
* RELEASE: 2013-09-03
* alex(AT)absolutemusic.co.uk
*
*/

// compare two lists together to see if the values in the ~selected are available in the ~allowed. Example use is for checking that the stores selected for magento are an allowed combination for the websites which are selected.


Let ( [
~allowed = allowedList ;
~selected =selectedList ;
~compare = Filter ( ~selected ; ~allowed )
] ;
If ( ~compare = ~selected ; "1" ; "0" )
)

// 1 = two lists differ 0 = they are the same
Binary file modified Standards.fmp12
Binary file not shown.