[filemakerfunctions] r32 committed - Updated to the new Clip Manager file format

17 views
Skip to first unread message

codesite...@google.com

unread,
Sep 8, 2009, 6:17:47 PM9/8/09
to filemaker...@googlegroups.com
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>&lt;CustomFunction
id="1" name="FW_GetActiveTabs" visible="True" parameters="init;theList"&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 ; "" )
+
+
+*/
+
+
+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( "¶" &amp; theList
&amp; "¶"; "¶" &amp;  parenttab &amp; "¶") ; 1  ;  0 )
+;
+theList = theList &amp; If( iscurrenttab ;   tabToCheck &amp; "¶" )
+
+]
+;   
+
+
+ If(not IsEmpty(tabToCheck) ; FW_GetActiveTabs(init; theList) ; theList)
+
+)]]&gt;
+&lt;/Calculation&gt;
+&lt;/CustomFunction&gt;</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>&lt;CustomFunction
id="1" name="SH_AddStringEvery" visible="True"
parameters="originalText;text;everyPosition;start"&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 ( "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 &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>
=======================================
--- /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>&lt;CustomFunction
id="1" name="SH_FormatCurrency" visible="True"
parameters="theSymbol;Amount;PositionSymbol;NumberOfDigits;Digit;Thousand"&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 = " ", ".", ","
+
+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 &amp; " " ; "")
+;
+post = If(pos="trailing" ; " " &amp; 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 )
&amp; "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 &amp; beforeDigitResult &amp;  theDigit &amp; afterdigit
&amp; post
+]
+;
+result
+)]]&gt;
+&lt;/Calculation&gt;
+&lt;/CustomFunction&gt;</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>&lt;CustomFunction
id="1" name="SH_GetScriptParameter" visible="True"
parameters="PropertyName"&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) ; "|" ;
$$SH_GetScriptParameter_separator)
+;
+countEqualsign = PatternCount( propertyList ; "=")
+;
+countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
+;
+thePropertylist = $$SH_GetScriptParameter_separator  &amp; propertylist
&amp; $$SH_GetScriptParameter_separator
+;
+checkstring1 = $$SH_GetScriptParameter_separator &amp; parameter &amp; "="
+;
+checkstring2 = $$SH_GetScriptParameter_separator &amp; " " &amp; parameter
&amp; "="
+;
+checkstring3 = $$SH_GetScriptParameter_separator &amp; parameter &amp; " ="
+;
+checkstring4 = $$SH_GetScriptParameter_separator &amp; " " &amp; parameter
&amp; " ="
+;
+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  &gt; 1
+;
+Let([$SH_errNum = 23 ; $SH_errText = "[error]Property name occures more
then once in the Propertylist" ] ; "" )
+;
+// Level 3
+countSeparator  = 0 and countEqualsign  &lt;&gt; 1
+;
+Let([$SH_errNum = 30 ; $SH_errText = "[error] invalid separator specified
in property list" ] ; "" )
+;
+countSeparator   &gt;=  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
+)
+)]]&gt;
+&lt;/Calculation&gt;
+&lt;/CustomFunction&gt;</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>&lt;CustomFunction
id="1" name="SH_GetScriptResult" visible="True"
parameters="PropertyName"&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) ; "|" ;
$$SH_GetScriptParameter_separator)
+;
+countEqualsign = PatternCount( propertyList ; "=")
+;
+countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
+;
+thePropertylist = $$SH_GetScriptParameter_separator  &amp; propertylist
&amp; $$SH_GetScriptParameter_separator
+;
+checkstring1 = $$SH_GetScriptParameter_separator &amp; parameter &amp; "="
+;
+checkstring2 = $$SH_GetScriptParameter_separator &amp; " " &amp; parameter
&amp; "="
+;
+checkstring3 = $$SH_GetScriptParameter_separator &amp; parameter &amp; " ="
+;
+checkstring4 = $$SH_GetScriptParameter_separator &amp; " " &amp; parameter
&amp; " ="
+;
+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  &gt; 1
+;
+Let([$SH_errNum = 23 ; $SH_errText = "[error]Property name occures more
then once in the Propertylist" ] ; "" )
+;
+// Level 3
+countSeparator  = 0 and countEqualsign  &lt;&gt; 1
+;
+Let([$SH_errNum = 30 ; $SH_errText = "[error] invalid separator specified
in property list" ] ; "" )
+;
+countSeparator   &gt;=  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
+)
+)]]&gt;
+&lt;/Calculation&gt;
+&lt;/CustomFunction&gt;</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>&amp;lt;CustomFunction
id=&amp;quot;1&amp;quot; name=&amp;quot;FW_GetActiveTabs&amp;quot;
visible=&amp;quot;True&amp;quot;
parameters=&amp;quot;init;theList&amp;quot;&amp;gt;
-&amp;lt;Calculation&amp;gt;
-&amp;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 ; &amp;quot;&amp;quot; )
-
-
-*/
-
-
-Let
-(
-[
-init = init + 1
-;
-objectList = LayoutObjectNames ( Get(FileName) ; Get(LayoutName) )
-;
-tabToCheck =  Substitute( GetValue(objectList; init)  ;
&amp;quot;¶&amp;quot; ; &amp;quot;&amp;quot;)
-;
-parenttab = GetLayoutObjectAttribute ( tabToCheck ;
&amp;quot;enclosingObject&amp;quot; )
-;
-iscurrenttab = Case( IsEmpty(tabToCheck) ; 
0  ;   GetLayoutObjectAttribute ( tabToCheck ;
&amp;quot;isFrontTabPanel&amp;quot;)  and IsEmpty(parenttab) ; 1 ;
GetLayoutObjectAttribute ( tabToCheck ;
&amp;quot;isFrontTabPanel&amp;quot;)  and PatternCount(
&amp;quot;¶&amp;quot; &amp;amp; theList &amp;amp; &amp;quot;¶&amp;quot;;
&amp;quot;¶&amp;quot; &amp;amp;  parenttab &amp;amp;
&amp;quot;¶&amp;quot;) ; 1  ;  0 )
-;
-theList = theList &amp;amp; If( iscurrenttab ;   tabToCheck &amp;amp;
&amp;quot;¶&amp;quot; )
-
-]
-;   
-
-
- If(not IsEmpty(tabToCheck) ; FW_GetActiveTabs(init; theList) ; theList)
-
-)]]&amp;gt;
-&amp;lt;/Calculation&amp;gt;
-&amp;lt;/CustomFunction&amp;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>&amp;lt;CustomFunction
id=&amp;quot;1&amp;quot; name=&amp;quot;SH_AddStringEvery&amp;quot;
visible=&amp;quot;True&amp;quot;
parameters=&amp;quot;originalText;text;everyPosition;start&amp;quot;&amp;gt;
-&amp;lt;Calculation&amp;gt;
-&amp;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 ( &amp;quot;xxxxx&amp;quot; ; &amp;quot;-&amp;quot; ;
2 ; &amp;quot;left&amp;quot; )
-xx-xx-x
-
-SH_AddStringEvery ( &amp;quot;xxxxx&amp;quot; ; &amp;quot;-&amp;quot; ;
2 ; &amp;quot;right&amp;quot; )
-x-xx-xx
-
-SH_AddStringEvery ( &amp;quot;4123245251524&amp;quot; ; &amp;quot;
&amp;quot; ; 3 ; &amp;quot;right&amp;quot; )
-4 123 245 251 524
-*/
-
-
-Let
-(
-[
-firstvalue = If(start=&amp;quot;left&amp;quot;; Left(originalText ;
everyPosition) ; Right(originalText ; everyPosition) )
-;
-nextText = If( start=&amp;quot;left&amp;quot; ; Right(originalText ;
Length(originalText)- everyPosition) ; Left(originalText ;
Length(originalText)- everyPosition) )
-]
-;
-If (
-start=&amp;quot;left&amp;quot;
-;
-firstvalue &amp;amp; If(not IsEmpty(nextText) ; text &amp;amp;
SH_AddStringEvery(nextText ; text ; everyPosition; start) )
-;
-If(not IsEmpty(nextText) ; SH_AddStringEvery(nextText ; text ;
everyPosition; start) &amp;amp; text ) &amp;amp; firstvalue
-)
-
-)]]&amp;gt;
-&amp;lt;/Calculation&amp;gt;
-&amp;lt;/CustomFunction&amp;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>&amp;lt;CustomFunction
id=&amp;quot;1&amp;quot; name=&amp;quot;SH_FormatCurrency&amp;quot;
visible=&amp;quot;True&amp;quot;
parameters=&amp;quot;theSymbol;Amount;PositionSymbol;NumberOfDigits;Digit;Thousand&amp;quot;&amp;gt;
-&amp;lt;Calculation&amp;gt;
-&amp;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 = &amp;quot; &amp;quot;, &amp;quot;.&amp;quot;,
&amp;quot;,&amp;quot;
-
-Requirements
-========
-Requires Function SH_AddStringEvery ( originalText ; text ;
everyPosition ; start )
-
-Usage
-====
-SH_FormatCurrency ( &amp;quot;USD&amp;quot; ; 1234567,3 ;
&amp;quot;leading&amp;quot; ; 2 ; &amp;quot;.&amp;quot; ;
&amp;quot;,&amp;quot; )
-USD 1,234,567.30
-
-SH_FormatCurrency ( &amp;quot;€&amp;quot; ; 1234567,3 ;
&amp;quot;leading&amp;quot; ; 0 ; &amp;quot;,&amp;quot; ; &amp;quot;
&amp;quot; )
-€ 1 234 567
-
-SH_FormatCurrency ( &amp;quot;EUR&amp;quot; ; 1234567,3 ;
&amp;quot;trailing&amp;quot; ; 0 ; &amp;quot;,&amp;quot; ; &amp;quot;
&amp;quot; )
-1 234 567 EUR
-
-*/
-
-Let
-(
-[
-pos = If(PositionSymbol = &amp;quot;trailing&amp;quot; ;
&amp;quot;trailing&amp;quot; ; &amp;quot;leading&amp;quot; )
-;
-pre = If(pos=&amp;quot;leading&amp;quot; ; theSymbol &amp;amp; &amp;quot;
&amp;quot; ; &amp;quot;&amp;quot;)
-;
-post = If(pos=&amp;quot;trailing&amp;quot; ; &amp;quot; &amp;quot;
&amp;amp; theSymbol ; &amp;quot;&amp;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;amp;
&amp;quot;0000000000000000000000000000000000000000000000000000&amp;quot;;
NumberOfDigits+1) ; &amp;quot;0123456789&amp;quot;) )
-;
-theDigit = If(not IsEmpty(afterDigit) ; Digit )
-;
-beforeDigit =  If(PatternCount(amountAsString; theSystemDigit) ;
Filter(Left(amountAsString ; Position(amountAsString; theSystemDigit ;
0 ;1) -1) ; &amp;quot;0123456789&amp;quot;) ; Filter(amountasstring ;
&amp;quot;0123456789&amp;quot;) )
-;
-beforeDigitResult = SH_AddStringEvery ( beforeDigit ; Thousand ; 3 ;
&amp;quot;right&amp;quot; )
-;
-result = pre &amp;amp; beforeDigitResult &amp;amp;  theDigit &amp;amp;
afterdigit &amp;amp; post
-]
-;
-result
-)]]&amp;gt;
-&amp;lt;/Calculation&amp;gt;
-&amp;lt;/CustomFunction&amp;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>&amp;lt;CustomFunction
id=&amp;quot;1&amp;quot; name=&amp;quot;SH_GetScriptParameter&amp;quot;
visible=&amp;quot;True&amp;quot;
parameters=&amp;quot;PropertyName&amp;quot;&amp;gt;
-&amp;lt;Calculation&amp;gt;
-&amp;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) ; &amp;quot;|&amp;quot; ;
$$SH_GetScriptParameter_separator)
-;
-countEqualsign = PatternCount( propertyList ; &amp;quot;=&amp;quot;)
-;
-countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
-;
-thePropertylist = $$SH_GetScriptParameter_separator  &amp;amp;
propertylist &amp;amp; $$SH_GetScriptParameter_separator
-;
-checkstring1 = $$SH_GetScriptParameter_separator &amp;amp; parameter
&amp;amp; &amp;quot;=&amp;quot;
-;
-checkstring2 = $$SH_GetScriptParameter_separator &amp;amp; &amp;quot;
&amp;quot; &amp;amp; parameter &amp;amp; &amp;quot;=&amp;quot;
-;
-checkstring3 = $$SH_GetScriptParameter_separator &amp;amp; parameter
&amp;amp; &amp;quot; =&amp;quot;
-;
-checkstring4 = $$SH_GetScriptParameter_separator &amp;amp; &amp;quot;
&amp;quot; &amp;amp; parameter &amp;amp; &amp;quot; =&amp;quot;
-;
-checkoccurences = PatternCount ( Substitute(thePropertylist; &amp;quot;
&amp;quot; ; &amp;quot;&amp;quot;) ; checkstring1 ) + PatternCount (
Substitute(thePropertylist; &amp;quot; &amp;quot; ; &amp;quot;&amp;quot;) ;
checkstring2 ) + PatternCount ( Substitute(thePropertylist; &amp;quot;
&amp;quot; ; &amp;quot;&amp;quot;) ; checkstring3 ) + PatternCount (
Substitute(thePropertylist; &amp;quot; &amp;quot; ; &amp;quot;&amp;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 = &amp;quot;[error] Propertylist is
empty&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-// Level 2
-IsEmpty(parameter)
-;
-Let([$SH_errNum = 21 ; $SH_errText = &amp;quot;[error] Property name is
empty&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-countEqualsign = 0
-;
-Let([$SH_errNum = 22 ; $SH_errText = &amp;quot;[error] No equal sign found
in property list&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-checkoccurences  &amp;gt; 1
-;
-Let([$SH_errNum = 23 ; $SH_errText = &amp;quot;[error]Property name
occures more then once in the Propertylist&amp;quot; ] ;
&amp;quot;&amp;quot; )
-;
-// Level 3
-countSeparator  = 0 and countEqualsign  &amp;lt;&amp;gt; 1
-;
-Let([$SH_errNum = 30 ; $SH_errText = &amp;quot;[error] invalid separator
specified in property list&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-countSeparator   &amp;gt;=  countEqualsign
-;
-Let([$SH_errNum = 31 ; $SH_errText = &amp;quot;[error] to many separators
found in property list&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-// Warnings
-checkoccurences = 0
-;
-Let([$SH_errNum = 9 ; $SH_errText = &amp;quot;[warning] Variable not
defined&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-IsEmpty(theValue)
-;
-Let([$SH_errNum = 1 ; $SH_errText = &amp;quot;[warning] Variable is
empty&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-// OK
-Let([$SH_errNum = 0 ; $SH_errText = &amp;quot;&amp;quot; ] ; theValue ) //
OK
-)
-)]]&amp;gt;
-&amp;lt;/Calculation&amp;gt;
-&amp;lt;/CustomFunction&amp;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>&amp;lt;CustomFunction
id=&amp;quot;1&amp;quot; name=&amp;quot;SH_GetScriptResult&amp;quot;
visible=&amp;quot;True&amp;quot;
parameters=&amp;quot;PropertyName&amp;quot;&amp;gt;
-&amp;lt;Calculation&amp;gt;
-&amp;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) ; &amp;quot;|&amp;quot; ;
$$SH_GetScriptParameter_separator)
-;
-countEqualsign = PatternCount( propertyList ; &amp;quot;=&amp;quot;)
-;
-countSeparator = PatternCount( propertyList ;
$$SH_GetScriptParameter_separator)
-;
-thePropertylist = $$SH_GetScriptParameter_separator  &amp;amp;
propertylist &amp;amp; $$SH_GetScriptParameter_separator
-;
-checkstring1 = $$SH_GetScriptParameter_separator &amp;amp; parameter
&amp;amp; &amp;quot;=&amp;quot;
-;
-checkstring2 = $$SH_GetScriptParameter_separator &amp;amp; &amp;quot;
&amp;quot; &amp;amp; parameter &amp;amp; &amp;quot;=&amp;quot;
-;
-checkstring3 = $$SH_GetScriptParameter_separator &amp;amp; parameter
&amp;amp; &amp;quot; =&amp;quot;
-;
-checkstring4 = $$SH_GetScriptParameter_separator &amp;amp; &amp;quot;
&amp;quot; &amp;amp; parameter &amp;amp; &amp;quot; =&amp;quot;
-;
-checkoccurences = PatternCount ( Substitute(thePropertylist; &amp;quot;
&amp;quot; ; &amp;quot;&amp;quot;) ; checkstring1 ) + PatternCount (
Substitute(thePropertylist; &amp;quot; &amp;quot; ; &amp;quot;&amp;quot;) ;
checkstring2 ) + PatternCount ( Substitute(thePropertylist; &amp;quot;
&amp;quot; ; &amp;quot;&amp;quot;) ; checkstring3 ) + PatternCount (
Substitute(thePropertylist; &amp;quot; &amp;quot; ; &amp;quot;&amp;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 = &amp;quot;[error] Propertylist is
empty&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-// Level 2
-IsEmpty(parameter)
-;
-Let([$SH_errNum = 21 ; $SH_errText = &amp;quot;[error] Property name is
empty&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-countEqualsign = 0
-;
-Let([$SH_errNum = 22 ; $SH_errText = &amp;quot;[error] No equal sign found
in property list&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-checkoccurences  &amp;gt; 1
-;
-Let([$SH_errNum = 23 ; $SH_errText = &amp;quot;[error]Property name
occures more then once in the Propertylist&amp;quot; ] ;
&amp;quot;&amp;quot; )
-;
-// Level 3
-countSeparator  = 0 and countEqualsign  &amp;lt;&amp;gt; 1
-;
-Let([$SH_errNum = 30 ; $SH_errText = &amp;quot;[error] invalid separator
specified in property list&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-countSeparator   &amp;gt;=  countEqualsign
-;
-Let([$SH_errNum = 31 ; $SH_errText = &amp;quot;[error] to many separators
found in property list&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-// Warnings
-checkoccurences = 0
-;
-Let([$SH_errNum = 9 ; $SH_errText = &amp;quot;[warning] Variable not
defined&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-IsEmpty(theValue)
-;
-Let([$SH_errNum = 1 ; $SH_errText = &amp;quot;[warning] Variable is
empty&amp;quot; ] ; &amp;quot;&amp;quot; )
-;
-// OK
-Let([$SH_errNum = 0 ; $SH_errText = &amp;quot;&amp;quot; ] ; theValue ) //
OK
-)
-)]]&amp;gt;
-&amp;lt;/Calculation&amp;gt;
-&amp;lt;/CustomFunction&amp;gt;</Clipboard><Picture></Picture></FMClipboard
>
Reply all
Reply to author
Forward
0 new messages