Revision: 32
Author:
ko...@shpartners.com
Date: Tue Sep 8 15:16:58 2009
Log: Updated to the new Clip Manager file format
http://code.google.com/p/filemakerfunctions/source/detail?r=32
Added:
/trunk/vanhulle/FW_GetActiveTabs.xmcf
/trunk/vanhulle/SH_AddStringEvery.xmcf
/trunk/vanhulle/SH_FormatCurrency.xmcf
/trunk/vanhulle/SH_GetScriptParameter.xmcf
/trunk/vanhulle/SH_GetScriptResult.xmcf
Deleted:
/trunk/vanhulle/FW_GetActiveTabs.xml
/trunk/vanhulle/SH_AddStringEvery.xml
/trunk/vanhulle/SH_FormatCurrency.xml
/trunk/vanhulle/SH_GetScriptParameter.xml
/trunk/vanhulle/SH_GetScriptResult.xml
=======================================
--- /dev/null
+++ /trunk/vanhulle/FW_GetActiveTabs.xmcf Tue Sep 8 15:16:58 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0"
encoding="UTF-8"?><FMClipboard><Version>31050522</Version><Comment>Version
History
+==========
+20070106 – KVH – Original version
+
+Description
+=======
+Get list of all active tabs that are in the front
+
+Usage
+====
+FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290403868</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard><CustomFunction
id="1" name="FW_GetActiveTabs" visible="True" parameters="init;theList">
+<Calculation>
+<![CDATA[// FW_GetActiveTabs ( init; theList )
+/*
+Version History
+==========
+20070106 – KVH – Original version
+
+Description
+=======
+Get list of all active tabs that are in the front
+
+Usage
+====
+FW_GetActiveTabs ( 0 ; "" )
+
+
+*/
+
+
+Let
+(
+[
+init = init + 1
+;
+objectList = LayoutObjectNames ( Get(FileName) ; Get(LayoutName) )
+;
+tabToCheck = Substitute( GetValue(objectList; init) ; "¶" ; "")
+;
+parenttab = GetLayoutObjectAttribute ( tabToCheck ; "enclosingObject" )
+;
+iscurrenttab = Case( IsEmpty(tabToCheck) ;
0 ; GetLayoutObjectAttribute ( tabToCheck ; "isFrontTabPanel") and
IsEmpty(parenttab) ; 1 ; GetLayoutObjectAttribute (
tabToCheck ; "isFrontTabPanel") and PatternCount( "¶" & theList
& "¶"; "¶" & parenttab & "¶") ; 1 ; 0 )
+;
+theList = theList & If( iscurrenttab ; tabToCheck & "¶" )
+
+]
+;
+
+
+ If(not IsEmpty(tabToCheck) ; FW_GetActiveTabs(init; theList) ; theList)
+
+)]]>
+</Calculation>
+</CustomFunction></Clipboard><Picture></Picture></FMClipboard>
=======================================
--- /dev/null
+++ /trunk/vanhulle/SH_AddStringEvery.xmcf Tue Sep 8 15:16:58 2009
@@ -0,0 +1,58 @@
+<?xml version="1.0"
encoding="UTF-8"?><FMClipboard><Version>31050522</Version><Comment>Version
History
+==========
+20070106 – KVH – Original version
+
+Description
+=======
+Get list of all active tabs that are in the front
+
+Usage
+====
+FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407337</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard><CustomFunction
id="1" name="SH_AddStringEvery" visible="True"
parameters="originalText;text;everyPosition;start">
+<Calculation>
+<![CDATA[// SH_AddStringEvery ( originalText ; text ; everyPosition ;
start )
+/*
+Version History
+==========
+20070117 – KVH – Original Version
+
+Description
+=======
+Parameters:
+originalText
+text: put this text between every x characters
+everyPosition = every x characters
+start = left|right
+
+Usage
+====
+SH_AddStringEvery ( "xxxxx" ; "-" ; 2 ; "left" )
+xx-xx-x
+
+SH_AddStringEvery ( "xxxxx" ; "-" ; 2 ; "right" )
+x-xx-xx
+
+SH_AddStringEvery ( "4123245251524" ; " " ; 3 ; "right" )
+4 123 245 251 524
+*/
+
+
+Let
+(
+[
+firstvalue = If(start="left"; Left(originalText ; everyPosition) ;
Right(originalText ; everyPosition) )
+;
+nextText = If( start="left" ; Right(originalText ; Length(originalText)-
everyPosition) ; Left(originalText ; Length(originalText)- everyPosition) )
+]
+;
+If (
+start="left"
+;
+firstvalue & If(not IsEmpty(nextText) ; text &
SH_AddStringEvery(nextText ; text ; everyPosition; start) )
+;
+If(not IsEmpty(nextText) ; SH_AddStringEvery(nextText ; text ;
everyPosition; start) & text ) & firstvalue
+)
+
+)]]>
+</Calculation>
+</CustomFunction></Clipboard><Picture></Picture></FMClipboard>
=======================================
--- /dev/null
+++ /trunk/vanhulle/SH_FormatCurrency.xmcf Tue Sep 8 15:16:58 2009
@@ -0,0 +1,75 @@
+<?xml version="1.0"
encoding="UTF-8"?><FMClipboard><Version>31050522</Version><Comment>Version
History
+==========
+20070106 – KVH – Original version
+
+Description
+=======
+Get list of all active tabs that are in the front
+
+Usage
+====
+FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407242</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard><CustomFunction
id="1" name="SH_FormatCurrency" visible="True"
parameters="theSymbol;Amount;PositionSymbol;NumberOfDigits;Digit;Thousand">
+<Calculation>
+<![CDATA[// SH_FormatCurrency (theSymbol; Amount; PositionSymbol;
NumberOfDigits ; Digit ; Thousand)
+/*
+Version History
+==========
+20070117 – KVH – Original Version
+
+Description
+=======
+Parameters:
+theSymbol: e.g; EUR, $, €
+Amount: 12,0434
+PositionSymbol: leading | trailing
+NumberOfDigits: 3 = xxx.xxx
+Digit = . ,
+Thousand = " ", ".", ","
+
+Requirements
+========
+Requires Function SH_AddStringEvery ( originalText ; text ;
everyPosition ; start )
+
+Usage
+====
+SH_FormatCurrency ( "USD" ; 1234567,3 ; "leading" ; 2 ; "." ; "," )
+USD 1,234,567.30
+
+SH_FormatCurrency ( "€" ; 1234567,3 ; "leading" ; 0 ; "," ; " " )
+€ 1 234 567
+
+SH_FormatCurrency ( "EUR" ; 1234567,3 ; "trailing" ; 0 ; "," ; " " )
+1 234 567 EUR
+
+*/
+
+Let
+(
+[
+pos = If(PositionSymbol = "trailing" ; "trailing" ; "leading" )
+;
+pre = If(pos="leading" ; theSymbol & " " ; "")
+;
+post = If(pos="trailing" ; " " & theSymbol ; "" )
+;
+theSystemDigit = Middle(GetAsText(Pi);2;1)
+;
+theAmount = Round(Amount;NumberOfDigits)
+;
+amountAsString = GetAsText( theAmount)
+;
+afterDigit = If(PatternCount(amountAsString; theSystemDigit) ; Filter(
Left( Right(amountAsString ; Length(amountAsString) -
Position(amountAsString; theSystemDigit ; 0 ;1) + 1 )
& "0000000000000000000000000000000000000000000000000000";
NumberOfDigits+1) ; "0123456789") )
+;
+theDigit = If(not IsEmpty(afterDigit) ; Digit )
+;
+beforeDigit = If(PatternCount(amountAsString; theSystemDigit) ;
Filter(Left(amountAsString ; Position(amountAsString; theSystemDigit ;
0 ;1) -1) ; "0123456789") ; Filter(amountasstring ; "0123456789") )
+;
+beforeDigitResult = SH_AddStringEvery ( beforeDigit ; Thousand ;
3 ; "right" )
+;
+result = pre & beforeDigitResult & theDigit & afterdigit
& post
+]
+;
+result
+)]]>
+</Calculation>
+</CustomFunction></Clipboard><Picture></Picture></FMClipboard>
=======================================
--- /dev/null
+++ /trunk/vanhulle/SH_GetScriptParameter.xmcf Tue Sep 8 15:16:58 2009
@@ -0,0 +1,110 @@
+<?xml version="1.0"
encoding="UTF-8"?><FMClipboard><Version>31050522</Version><Comment>Version
History
+==========
+20070106 – KVH – Original version
+
+Description
+=======
+Get list of all active tabs that are in the front
+
+Usage
+====
+FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407015</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard><CustomFunction
id="1" name="SH_GetScriptParameter" visible="True"
parameters="PropertyName">
+<Calculation>
+<![CDATA[// SH_GetScriptParameter ( PropertyName )
+/*
+Version History
+==========
+20060927 – KVH -
+
+Description
+=======
+Function Name : SH_GetScriptParameter
+parameter 1 : PropertyName
+
+Output:
+$SH_errNum : Error Number
+$SH_errText : Error Text
+
+
+*/
+
+Let (
+[
+parameter = PropertyName
+;
+propertylist = Get ( ScriptParameter )
+;
+$$SH_GetScriptParameter_separator =
If(IsEmpty($$SH_GetScriptParameter_separator) ; "|" ;
$$SH_GetScriptParameter_separator)
+;
+countEqualsign = PatternCount( propertyList ; "=")
+;
+countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
+;
+thePropertylist = $$SH_GetScriptParameter_separator & propertylist
& $$SH_GetScriptParameter_separator
+;
+checkstring1 = $$SH_GetScriptParameter_separator & parameter & "="
+;
+checkstring2 = $$SH_GetScriptParameter_separator & " " & parameter
& "="
+;
+checkstring3 = $$SH_GetScriptParameter_separator & parameter & " ="
+;
+checkstring4 = $$SH_GetScriptParameter_separator & " " & parameter
& " ="
+;
+checkoccurences = PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring1 ) + PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring2 ) + PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring3 ) + PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring4 )
+;
+paramPos = Position ( thePropertylist ; checkstring1 ; 1 ; 1 ) +Position (
thePropertylist ; checkstring2 ; 1 ; 1 ) + Position ( thePropertylist ;
checkstring3 ; 1 ; 1 ) + Position ( thePropertylist ; checkstring4 ; 1 ; 1 )
+;
+posCorrection = If(Position ( thePropertylist ; checkstring2 ; 1 ; 1 ) ;
1) + If(Position ( thePropertylist ; checkstring3 ; 1 ; 1 );1) +
If(Position ( thePropertylist ; checkstring4 ; 1 ; 1 ) ; 2)
+;
+startValue = parampos + Length(parameter) + posCorrection + 2
+;
+endValue = Position ( thepropertylist ;
$$SH_GetScriptParameter_separator ; startValue ; 1 )
+;
+theValue = Middle ( thepropertylist ; startValue ; endValue - startValue )
+
+]
+;
+Case
+(
+// Level 1
+IsEmpty(propertylist)
+;
+Let([$SH_errNum = 10 ; $SH_errText = "[error] Propertylist is empty"
] ; "" )
+;
+// Level 2
+IsEmpty(parameter)
+;
+Let([$SH_errNum = 21 ; $SH_errText = "[error] Property name is empty"
] ; "" )
+;
+countEqualsign = 0
+;
+Let([$SH_errNum = 22 ; $SH_errText = "[error] No equal sign found in
property list" ] ; "" )
+;
+checkoccurences > 1
+;
+Let([$SH_errNum = 23 ; $SH_errText = "[error]Property name occures more
then once in the Propertylist" ] ; "" )
+;
+// Level 3
+countSeparator = 0 and countEqualsign <> 1
+;
+Let([$SH_errNum = 30 ; $SH_errText = "[error] invalid separator specified
in property list" ] ; "" )
+;
+countSeparator >= countEqualsign
+;
+Let([$SH_errNum = 31 ; $SH_errText = "[error] to many separators found in
property list" ] ; "" )
+;
+// Warnings
+checkoccurences = 0
+;
+Let([$SH_errNum = 9 ; $SH_errText = "[warning] Variable not defined"
] ; "" )
+;
+IsEmpty(theValue)
+;
+Let([$SH_errNum = 1 ; $SH_errText = "[warning] Variable is empty" ] ; "" )
+;
+// OK
+Let([$SH_errNum = 0 ; $SH_errText = "" ] ; theValue ) // OK
+)
+)]]>
+</Calculation>
+</CustomFunction></Clipboard><Picture></Picture></FMClipboard>
=======================================
--- /dev/null
+++ /trunk/vanhulle/SH_GetScriptResult.xmcf Tue Sep 8 15:16:58 2009
@@ -0,0 +1,110 @@
+<?xml version="1.0"
encoding="UTF-8"?><FMClipboard><Version>31050522</Version><Comment>Version
History
+==========
+20070106 – KVH – Original version
+
+Description
+=======
+Get list of all active tabs that are in the front
+
+Usage
+====
+FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407119</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard><CustomFunction
id="1" name="SH_GetScriptResult" visible="True"
parameters="PropertyName">
+<Calculation>
+<![CDATA[// SH_GetScriptResult ( PropertyName )
+/*
+Version History
+==========
+20060927 – KVH -
+
+Description
+=======
+Function Name : SH_GetScriptParameter
+parameter 1 : PropertyName
+
+Output:
+$SH_errNum : Error Number
+$SH_errText : Error Text
+
+
+*/
+
+Let (
+[
+parameter = PropertyName
+;
+propertylist = Get ( ScriptResult )
+;
+$$SH_GetScriptParameter_separator =
If(IsEmpty($$SH_GetScriptParameter_separator) ; "|" ;
$$SH_GetScriptParameter_separator)
+;
+countEqualsign = PatternCount( propertyList ; "=")
+;
+countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
+;
+thePropertylist = $$SH_GetScriptParameter_separator & propertylist
& $$SH_GetScriptParameter_separator
+;
+checkstring1 = $$SH_GetScriptParameter_separator & parameter & "="
+;
+checkstring2 = $$SH_GetScriptParameter_separator & " " & parameter
& "="
+;
+checkstring3 = $$SH_GetScriptParameter_separator & parameter & " ="
+;
+checkstring4 = $$SH_GetScriptParameter_separator & " " & parameter
& " ="
+;
+checkoccurences = PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring1 ) + PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring2 ) + PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring3 ) + PatternCount ( Substitute(thePropertylist; " " ; "") ;
checkstring4 )
+;
+paramPos = Position ( thePropertylist ; checkstring1 ; 1 ; 1 ) +Position (
thePropertylist ; checkstring2 ; 1 ; 1 ) + Position ( thePropertylist ;
checkstring3 ; 1 ; 1 ) + Position ( thePropertylist ; checkstring4 ; 1 ; 1 )
+;
+posCorrection = If(Position ( thePropertylist ; checkstring2 ; 1 ; 1 ) ;
1) + If(Position ( thePropertylist ; checkstring3 ; 1 ; 1 );1) +
If(Position ( thePropertylist ; checkstring4 ; 1 ; 1 ) ; 2)
+;
+startValue = parampos + Length(parameter) + posCorrection + 2
+;
+endValue = Position ( thepropertylist ;
$$SH_GetScriptParameter_separator ; startValue ; 1 )
+;
+theValue = Middle ( thepropertylist ; startValue ; endValue - startValue )
+
+]
+;
+Case
+(
+// Level 1
+IsEmpty(propertylist)
+;
+Let([$SH_errNum = 10 ; $SH_errText = "[error] Propertylist is empty"
] ; "" )
+;
+// Level 2
+IsEmpty(parameter)
+;
+Let([$SH_errNum = 21 ; $SH_errText = "[error] Property name is empty"
] ; "" )
+;
+countEqualsign = 0
+;
+Let([$SH_errNum = 22 ; $SH_errText = "[error] No equal sign found in
property list" ] ; "" )
+;
+checkoccurences > 1
+;
+Let([$SH_errNum = 23 ; $SH_errText = "[error]Property name occures more
then once in the Propertylist" ] ; "" )
+;
+// Level 3
+countSeparator = 0 and countEqualsign <> 1
+;
+Let([$SH_errNum = 30 ; $SH_errText = "[error] invalid separator specified
in property list" ] ; "" )
+;
+countSeparator >= countEqualsign
+;
+Let([$SH_errNum = 31 ; $SH_errText = "[error] to many separators found in
property list" ] ; "" )
+;
+// Warnings
+checkoccurences = 0
+;
+Let([$SH_errNum = 9 ; $SH_errText = "[warning] Variable not defined"
] ; "" )
+;
+IsEmpty(theValue)
+;
+Let([$SH_errNum = 1 ; $SH_errText = "[warning] Variable is empty" ] ; "" )
+;
+// OK
+Let([$SH_errNum = 0 ; $SH_errText = "" ] ; theValue ) // OK
+)
+)]]>
+</Calculation>
+</CustomFunction></Clipboard><Picture></Picture></FMClipboard>
=======================================
--- /trunk/vanhulle/FW_GetActiveTabs.xml Mon Apr 7 12:49:07 2008
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FMClipboard ><Version>20000102</Version><Comment>Version History
-==========
-20070106 – KVH – Original version
-
-Description
-=======
-Get list of all active tabs that are in the front
-
-Usage
-====
-FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290403868</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard>&lt;CustomFunction
id=&quot;1&quot; name=&quot;FW_GetActiveTabs&quot;
visible=&quot;True&quot;
parameters=&quot;init;theList&quot;&gt;
-&lt;Calculation&gt;
-&lt;![CDATA[// FW_GetActiveTabs ( init; theList )
-/*
-Version History
-==========
-20070106 – KVH – Original version
-
-Description
-=======
-Get list of all active tabs that are in the front
-
-Usage
-====
-FW_GetActiveTabs ( 0 ; &quot;&quot; )
-
-
-*/
-
-
-Let
-(
-[
-init = init + 1
-;
-objectList = LayoutObjectNames ( Get(FileName) ; Get(LayoutName) )
-;
-tabToCheck = Substitute( GetValue(objectList; init) ;
&quot;¶&quot; ; &quot;&quot;)
-;
-parenttab = GetLayoutObjectAttribute ( tabToCheck ;
&quot;enclosingObject&quot; )
-;
-iscurrenttab = Case( IsEmpty(tabToCheck) ;
0 ; GetLayoutObjectAttribute ( tabToCheck ;
&quot;isFrontTabPanel&quot;) and IsEmpty(parenttab) ; 1 ;
GetLayoutObjectAttribute ( tabToCheck ;
&quot;isFrontTabPanel&quot;) and PatternCount(
&quot;¶&quot; &amp; theList &amp; &quot;¶&quot;;
&quot;¶&quot; &amp; parenttab &amp;
&quot;¶&quot;) ; 1 ; 0 )
-;
-theList = theList &amp; If( iscurrenttab ; tabToCheck &amp;
&quot;¶&quot; )
-
-]
-;
-
-
- If(not IsEmpty(tabToCheck) ; FW_GetActiveTabs(init; theList) ; theList)
-
-)]]&gt;
-&lt;/Calculation&gt;
-&lt;/CustomFunction&gt;</Clipboard><Picture></Picture></FMClipboard
>
=======================================
--- /trunk/vanhulle/SH_AddStringEvery.xml Mon Apr 7 13:07:10 2008
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FMClipboard ><Version>20000102</Version><Comment>Version History
-==========
-20070106 – KVH – Original version
-
-Description
-=======
-Get list of all active tabs that are in the front
-
-Usage
-====
-FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407337</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard>&lt;CustomFunction
id=&quot;1&quot; name=&quot;SH_AddStringEvery&quot;
visible=&quot;True&quot;
parameters=&quot;originalText;text;everyPosition;start&quot;&gt;
-&lt;Calculation&gt;
-&lt;![CDATA[// SH_AddStringEvery ( originalText ; text ;
everyPosition ; start )
-/*
-Version History
-==========
-20070117 – KVH – Original Version
-
-Description
-=======
-Parameters:
-originalText
-text: put this text between every x characters
-everyPosition = every x characters
-start = left|right
-
-Usage
-====
-SH_AddStringEvery ( &quot;xxxxx&quot; ; &quot;-&quot; ;
2 ; &quot;left&quot; )
-xx-xx-x
-
-SH_AddStringEvery ( &quot;xxxxx&quot; ; &quot;-&quot; ;
2 ; &quot;right&quot; )
-x-xx-xx
-
-SH_AddStringEvery ( &quot;4123245251524&quot; ; &quot;
&quot; ; 3 ; &quot;right&quot; )
-4 123 245 251 524
-*/
-
-
-Let
-(
-[
-firstvalue = If(start=&quot;left&quot;; Left(originalText ;
everyPosition) ; Right(originalText ; everyPosition) )
-;
-nextText = If( start=&quot;left&quot; ; Right(originalText ;
Length(originalText)- everyPosition) ; Left(originalText ;
Length(originalText)- everyPosition) )
-]
-;
-If (
-start=&quot;left&quot;
-;
-firstvalue &amp; If(not IsEmpty(nextText) ; text &amp;
SH_AddStringEvery(nextText ; text ; everyPosition; start) )
-;
-If(not IsEmpty(nextText) ; SH_AddStringEvery(nextText ; text ;
everyPosition; start) &amp; text ) &amp; firstvalue
-)
-
-)]]&gt;
-&lt;/Calculation&gt;
-&lt;/CustomFunction&gt;</Clipboard><Picture></Picture></FMClipboard
>
=======================================
--- /trunk/vanhulle/SH_FormatCurrency.xml Mon Apr 7 13:07:10 2008
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FMClipboard ><Version>20000102</Version><Comment>Version History
-==========
-20070106 – KVH – Original version
-
-Description
-=======
-Get list of all active tabs that are in the front
-
-Usage
-====
-FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407242</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard>&lt;CustomFunction
id=&quot;1&quot; name=&quot;SH_FormatCurrency&quot;
visible=&quot;True&quot;
parameters=&quot;theSymbol;Amount;PositionSymbol;NumberOfDigits;Digit;Thousand&quot;&gt;
-&lt;Calculation&gt;
-&lt;![CDATA[// SH_FormatCurrency (theSymbol; Amount; PositionSymbol;
NumberOfDigits ; Digit ; Thousand)
-/*
-Version History
-==========
-20070117 – KVH – Original Version
-
-Description
-=======
-Parameters:
-theSymbol: e.g; EUR, $, €
-Amount: 12,0434
-PositionSymbol: leading | trailing
-NumberOfDigits: 3 = xxx.xxx
-Digit = . ,
-Thousand = &quot; &quot;, &quot;.&quot;,
&quot;,&quot;
-
-Requirements
-========
-Requires Function SH_AddStringEvery ( originalText ; text ;
everyPosition ; start )
-
-Usage
-====
-SH_FormatCurrency ( &quot;USD&quot; ; 1234567,3 ;
&quot;leading&quot; ; 2 ; &quot;.&quot; ;
&quot;,&quot; )
-USD 1,234,567.30
-
-SH_FormatCurrency ( &quot;€&quot; ; 1234567,3 ;
&quot;leading&quot; ; 0 ; &quot;,&quot; ; &quot;
&quot; )
-€ 1 234 567
-
-SH_FormatCurrency ( &quot;EUR&quot; ; 1234567,3 ;
&quot;trailing&quot; ; 0 ; &quot;,&quot; ; &quot;
&quot; )
-1 234 567 EUR
-
-*/
-
-Let
-(
-[
-pos = If(PositionSymbol = &quot;trailing&quot; ;
&quot;trailing&quot; ; &quot;leading&quot; )
-;
-pre = If(pos=&quot;leading&quot; ; theSymbol &amp; &quot;
&quot; ; &quot;&quot;)
-;
-post = If(pos=&quot;trailing&quot; ; &quot; &quot;
&amp; theSymbol ; &quot;&quot; )
-;
-theSystemDigit = Middle(GetAsText(Pi);2;1)
-;
-theAmount = Round(Amount;NumberOfDigits)
-;
-amountAsString = GetAsText( theAmount)
-;
-afterDigit = If(PatternCount(amountAsString; theSystemDigit) ; Filter(
Left( Right(amountAsString ; Length(amountAsString) -
Position(amountAsString; theSystemDigit ; 0 ;1) + 1 ) &amp;
&quot;0000000000000000000000000000000000000000000000000000&quot;;
NumberOfDigits+1) ; &quot;0123456789&quot;) )
-;
-theDigit = If(not IsEmpty(afterDigit) ; Digit )
-;
-beforeDigit = If(PatternCount(amountAsString; theSystemDigit) ;
Filter(Left(amountAsString ; Position(amountAsString; theSystemDigit ;
0 ;1) -1) ; &quot;0123456789&quot;) ; Filter(amountasstring ;
&quot;0123456789&quot;) )
-;
-beforeDigitResult = SH_AddStringEvery ( beforeDigit ; Thousand ; 3 ;
&quot;right&quot; )
-;
-result = pre &amp; beforeDigitResult &amp; theDigit &amp;
afterdigit &amp; post
-]
-;
-result
-)]]&gt;
-&lt;/Calculation&gt;
-&lt;/CustomFunction&gt;</Clipboard><Picture></Picture></FMClipboard
>
=======================================
--- /trunk/vanhulle/SH_GetScriptParameter.xml Mon Apr 7 13:07:10 2008
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FMClipboard ><Version>20000102</Version><Comment>Version History
-==========
-20070106 – KVH – Original version
-
-Description
-=======
-Get list of all active tabs that are in the front
-
-Usage
-====
-FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407015</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard>&lt;CustomFunction
id=&quot;1&quot; name=&quot;SH_GetScriptParameter&quot;
visible=&quot;True&quot;
parameters=&quot;PropertyName&quot;&gt;
-&lt;Calculation&gt;
-&lt;![CDATA[// SH_GetScriptParameter ( PropertyName )
-/*
-Version History
-==========
-20060927 – KVH -
-
-Description
-=======
-Function Name : SH_GetScriptParameter
-parameter 1 : PropertyName
-
-Output:
-$SH_errNum : Error Number
-$SH_errText : Error Text
-
-
-*/
-
-Let (
-[
-parameter = PropertyName
-;
-propertylist = Get ( ScriptParameter )
-;
-$$SH_GetScriptParameter_separator =
If(IsEmpty($$SH_GetScriptParameter_separator) ; &quot;|&quot; ;
$$SH_GetScriptParameter_separator)
-;
-countEqualsign = PatternCount( propertyList ; &quot;=&quot;)
-;
-countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
-;
-thePropertylist = $$SH_GetScriptParameter_separator &amp;
propertylist &amp; $$SH_GetScriptParameter_separator
-;
-checkstring1 = $$SH_GetScriptParameter_separator &amp; parameter
&amp; &quot;=&quot;
-;
-checkstring2 = $$SH_GetScriptParameter_separator &amp; &quot;
&quot; &amp; parameter &amp; &quot;=&quot;
-;
-checkstring3 = $$SH_GetScriptParameter_separator &amp; parameter
&amp; &quot; =&quot;
-;
-checkstring4 = $$SH_GetScriptParameter_separator &amp; &quot;
&quot; &amp; parameter &amp; &quot; =&quot;
-;
-checkoccurences = PatternCount ( Substitute(thePropertylist; &quot;
&quot; ; &quot;&quot;) ; checkstring1 ) + PatternCount (
Substitute(thePropertylist; &quot; &quot; ; &quot;&quot;) ;
checkstring2 ) + PatternCount ( Substitute(thePropertylist; &quot;
&quot; ; &quot;&quot;) ; checkstring3 ) + PatternCount (
Substitute(thePropertylist; &quot; &quot; ; &quot;&quot;) ;
checkstring4 )
-;
-paramPos = Position ( thePropertylist ; checkstring1 ; 1 ; 1 ) +Position (
thePropertylist ; checkstring2 ; 1 ; 1 ) + Position ( thePropertylist ;
checkstring3 ; 1 ; 1 ) + Position ( thePropertylist ; checkstring4 ; 1 ; 1 )
-;
-posCorrection = If(Position ( thePropertylist ; checkstring2 ; 1 ; 1 ) ;
1) + If(Position ( thePropertylist ; checkstring3 ; 1 ; 1 );1) +
If(Position ( thePropertylist ; checkstring4 ; 1 ; 1 ) ; 2)
-;
-startValue = parampos + Length(parameter) + posCorrection + 2
-;
-endValue = Position ( thepropertylist ;
$$SH_GetScriptParameter_separator ; startValue ; 1 )
-;
-theValue = Middle ( thepropertylist ; startValue ; endValue - startValue )
-
-]
-;
-Case
-(
-// Level 1
-IsEmpty(propertylist)
-;
-Let([$SH_errNum = 10 ; $SH_errText = &quot;[error] Propertylist is
empty&quot; ] ; &quot;&quot; )
-;
-// Level 2
-IsEmpty(parameter)
-;
-Let([$SH_errNum = 21 ; $SH_errText = &quot;[error] Property name is
empty&quot; ] ; &quot;&quot; )
-;
-countEqualsign = 0
-;
-Let([$SH_errNum = 22 ; $SH_errText = &quot;[error] No equal sign found
in property list&quot; ] ; &quot;&quot; )
-;
-checkoccurences &gt; 1
-;
-Let([$SH_errNum = 23 ; $SH_errText = &quot;[error]Property name
occures more then once in the Propertylist&quot; ] ;
&quot;&quot; )
-;
-// Level 3
-countSeparator = 0 and countEqualsign &lt;&gt; 1
-;
-Let([$SH_errNum = 30 ; $SH_errText = &quot;[error] invalid separator
specified in property list&quot; ] ; &quot;&quot; )
-;
-countSeparator &gt;= countEqualsign
-;
-Let([$SH_errNum = 31 ; $SH_errText = &quot;[error] to many separators
found in property list&quot; ] ; &quot;&quot; )
-;
-// Warnings
-checkoccurences = 0
-;
-Let([$SH_errNum = 9 ; $SH_errText = &quot;[warning] Variable not
defined&quot; ] ; &quot;&quot; )
-;
-IsEmpty(theValue)
-;
-Let([$SH_errNum = 1 ; $SH_errText = &quot;[warning] Variable is
empty&quot; ] ; &quot;&quot; )
-;
-// OK
-Let([$SH_errNum = 0 ; $SH_errText = &quot;&quot; ] ; theValue ) //
OK
-)
-)]]&gt;
-&lt;/Calculation&gt;
-&lt;/CustomFunction&gt;</Clipboard><Picture></Picture></FMClipboard
>
=======================================
--- /trunk/vanhulle/SH_GetScriptResult.xml Mon Apr 7 13:07:10 2008
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FMClipboard ><Version>20000102</Version><Comment>Version History
-==========
-20070106 – KVH – Original version
-
-Description
-=======
-Get list of all active tabs that are in the front
-
-Usage
-====
-FW_GetActiveTabs ( 0 ; "" )
</Comment><SourceWindowName></SourceWindowName><Class>XMCF</Class><ClipVersion></ClipVersion><ClipTimeStamp>3290407119</ClipTimeStamp><ClipAuthor></ClipAuthor><Clipboard>&lt;CustomFunction
id=&quot;1&quot; name=&quot;SH_GetScriptResult&quot;
visible=&quot;True&quot;
parameters=&quot;PropertyName&quot;&gt;
-&lt;Calculation&gt;
-&lt;![CDATA[// SH_GetScriptResult ( PropertyName )
-/*
-Version History
-==========
-20060927 – KVH -
-
-Description
-=======
-Function Name : SH_GetScriptParameter
-parameter 1 : PropertyName
-
-Output:
-$SH_errNum : Error Number
-$SH_errText : Error Text
-
-
-*/
-
-Let (
-[
-parameter = PropertyName
-;
-propertylist = Get ( ScriptResult )
-;
-$$SH_GetScriptParameter_separator =
If(IsEmpty($$SH_GetScriptParameter_separator) ; &quot;|&quot; ;
$$SH_GetScriptParameter_separator)
-;
-countEqualsign = PatternCount( propertyList ; &quot;=&quot;)
-;
-countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
-;
-thePropertylist = $$SH_GetScriptParameter_separator &amp;
propertylist &amp; $$SH_GetScriptParameter_separator
-;
-checkstring1 = $$SH_GetScriptParameter_separator &amp; parameter
&amp; &quot;=&quot;
-;
-checkstring2 = $$SH_GetScriptParameter_separator &amp; &quot;
&quot; &amp; parameter &amp; &quot;=&quot;
-;
-checkstring3 = $$SH_GetScriptParameter_separator &amp; parameter
&amp; &quot; =&quot;
-;
-checkstring4 = $$SH_GetScriptParameter_separator &amp; &quot;
&quot; &amp; parameter &amp; &quot; =&quot;
-;
-checkoccurences = PatternCount ( Substitute(thePropertylist; &quot;
&quot; ; &quot;&quot;) ; checkstring1 ) + PatternCount (
Substitute(thePropertylist; &quot; &quot; ; &quot;&quot;) ;
checkstring2 ) + PatternCount ( Substitute(thePropertylist; &quot;
&quot; ; &quot;&quot;) ; checkstring3 ) + PatternCount (
Substitute(thePropertylist; &quot; &quot; ; &quot;&quot;) ;
checkstring4 )
-;
-paramPos = Position ( thePropertylist ; checkstring1 ; 1 ; 1 ) +Position (
thePropertylist ; checkstring2 ; 1 ; 1 ) + Position ( thePropertylist ;
checkstring3 ; 1 ; 1 ) + Position ( thePropertylist ; checkstring4 ; 1 ; 1 )
-;
-posCorrection = If(Position ( thePropertylist ; checkstring2 ; 1 ; 1 ) ;
1) + If(Position ( thePropertylist ; checkstring3 ; 1 ; 1 );1) +
If(Position ( thePropertylist ; checkstring4 ; 1 ; 1 ) ; 2)
-;
-startValue = parampos + Length(parameter) + posCorrection + 2
-;
-endValue = Position ( thepropertylist ;
$$SH_GetScriptParameter_separator ; startValue ; 1 )
-;
-theValue = Middle ( thepropertylist ; startValue ; endValue - startValue )
-
-]
-;
-Case
-(
-// Level 1
-IsEmpty(propertylist)
-;
-Let([$SH_errNum = 10 ; $SH_errText = &quot;[error] Propertylist is
empty&quot; ] ; &quot;&quot; )
-;
-// Level 2
-IsEmpty(parameter)
-;
-Let([$SH_errNum = 21 ; $SH_errText = &quot;[error] Property name is
empty&quot; ] ; &quot;&quot; )
-;
-countEqualsign = 0
-;
-Let([$SH_errNum = 22 ; $SH_errText = &quot;[error] No equal sign found
in property list&quot; ] ; &quot;&quot; )
-;
-checkoccurences &gt; 1
-;
-Let([$SH_errNum = 23 ; $SH_errText = &quot;[error]Property name
occures more then once in the Propertylist&quot; ] ;
&quot;&quot; )
-;
-// Level 3
-countSeparator = 0 and countEqualsign &lt;&gt; 1
-;
-Let([$SH_errNum = 30 ; $SH_errText = &quot;[error] invalid separator
specified in property list&quot; ] ; &quot;&quot; )
-;
-countSeparator &gt;= countEqualsign
-;
-Let([$SH_errNum = 31 ; $SH_errText = &quot;[error] to many separators
found in property list&quot; ] ; &quot;&quot; )
-;
-// Warnings
-checkoccurences = 0
-;
-Let([$SH_errNum = 9 ; $SH_errText = &quot;[warning] Variable not
defined&quot; ] ; &quot;&quot; )
-;
-IsEmpty(theValue)
-;
-Let([$SH_errNum = 1 ; $SH_errText = &quot;[warning] Variable is
empty&quot; ] ; &quot;&quot; )
-;
-// OK
-Let([$SH_errNum = 0 ; $SH_errText = &quot;&quot; ] ; theValue ) //
OK
-)
-)]]&gt;
-&lt;/Calculation&gt;
-&lt;/CustomFunction&gt;</Clipboard><Picture></Picture></FMClipboard
>