User Tools

Site Tools


vba:functions:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
vba:functions:index [07.10.2014 14:35:37]
yaslaw
vba:functions:index [31.08.2015 09:20:44]
yaslaw
Line 1: Line 1:
 +~~DISCUSSION:​off~~
 +~~NOCACHE~~ ​
 +<​const>​ns=%NAMESPACE%</​const>​
 ======Functions====== ======Functions======
 {{:​vba:​functions:​functions.bas|}} {{:​vba:​functions:​functions.bas|}}
Line 18: Line 21:
 ===== Funktionen mit eigener Seite ===== ===== Funktionen mit eigener Seite =====
 {{pagequery>​ {{pagequery>​
-  ​@vba:​functions:​ *; +  ​^vba:​functions:​(?!index)[^:​]+(?::​index)?$
-  filter=id:vba:​functions:​[^:​]+(?::​index|)$,​^id:​vba:​functions:​index+  fullregex
-  sort=title;+  sort=ns:asc,title:asc;
   display={title};​   display={title};​
-  snippet=plain,​all,w30;+  snippet=plain,​999999,l1;
   bullet=square;​   bullet=square;​
   fontsize=100%;​   fontsize=100%;​
Line 28: Line 31:
   hidejump;   hidejump;
  }}  }}
 +
 +
 +
  
  
Line 229: Line 235:
 Public Function bitComp(ByVal iBytes As Integer, ByVal iBit As Integer) As Boolean Public Function bitComp(ByVal iBytes As Integer, ByVal iBit As Integer) As Boolean
     bitComp = (iBytes And iBit)     bitComp = (iBytes And iBit)
-End Function 
-</​code>​ 
- 
-====greatest()==== 
-Analog zu max(). Jedoch mit mehreren Werten 
-<code vb greatest.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' * 
-' * Gibt den Grössten aus einer unbestimmten Menge von Werten zurück 
-' * @param ​ Keine Objekte 
-' * @return Grösster Wert 
-' * @example greatest("​Hallo Welt", 42, "​Mister-X"​) -> Mister-X 
-'*/ 
-Private Function greatest(ParamArray iItems() As Variant) As Variant 
-    greatest = iItems(UBound(iItems)) 
-    Dim item As Variant: For Each item In iItems 
-        If Nz(item) > Nz(greatest) Then greatest = item 
-    Next item 
-End Function 
-</​code>​ 
- 
-====least()==== 
-Analog zu min(). Jedoch mit mehreren Werten 
-<code vb least.bas>​ 
-'/** 
-' * Gibt den Kleinsten aus einer unbestimmten Menge von Werten zurück 
-' * @param ​ Keine Objekte 
-' * @return Grösster Wert 
-' * @example least("​Hallo Welt", 42, "​Mister-X"​) -> 42 
-'*/ 
-Private Function least(ParamArray iItems() As Variant) As Variant 
-    least = iItems(LBound(iItems)) 
-    Dim item As Variant: For Each item In iItems 
-        If Nz(item) < Nz(least) Then least = item 
-    Next item 
-End Function 
-</​code>​ 
- 
-====getMax()==== 
-<code vb getMax.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' *  
-' * Gibt den Höheren von 2 Werten zurück 
-' * @param ​ Variant ​    Wert 1 
-' * @param ​ Variant ​    Wert 2 
-' * @return Variant ​    der Grössere Wert 
-' */ 
-Public Function getMax(ByVal iValue1 As Variant, ByVal iValue2 As Variant) As Variant 
- If iValue1 > iValue2 Then 
- getMax= iValue1 
- Else 
- getMax= iValue2 
- End If 
-End Function 
-</​code>​ 
- 
-====getMin()==== 
-<code vb getMin.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' *  
-' * Gibt den Tieferen von 2 Werten zurück 
-' * @param ​ Variant ​    Wert 1 
-' * @param ​ Variant ​    Wert 2 
-' * @return Variant ​    der Kleinere Wert 
-' */ 
-Public Function getMin(ByVal iValue1 As Variant, ByVal iValue2 As Variant) As Variant 
- If iValue1 < iValue2 Then 
- getMin= iValue1 
- Else 
- getMin= iValue2 
- End If 
 End Function End Function
 </​code>​ </​code>​
Line 329: Line 261:
  End If  End If
   
-End Function 
-</​code>​ 
- 
-====firstValue()==== 
-<code vb firstValue.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' *  
-' * gibt den ersten Eintrag der nicht NULL ist zurück. 
-' * Ist sehr gut geeignet um aus Queries zuzugreiffen 
-' * Die Funktion funktioniert auch mit Objekten 
-' * @return Variant 
-' * @example: 
-' * ?​firstValue(null,​ null,13,14, null)  //​Rückgabewert 13 
-' */ 
-Public Function firstValue(ParamArray items() As Variant) As Variant 
- For Each firstValue In items 
- If Not IsNull(firstValue) Then Exit For 
- Next 
-End Function 
-</​code>​ 
- 
-====find_in_set()==== 
-Analog zu MySQL FIND_IN_SET(). Kann in Access vor allem bei nichtnormalisierten Tabellen verwendet werden 
-<code vb find_in_set.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' *  
-' * Analog zu MySQL FIND_IN_SET() 
-' * Kann in Access vor allem bei nichtnormalisierten Tabellen verwendet werden 
-' * @param ​ String ​ Element das gesucht wird 
-' * @param ​ String ​ Das Set von Elementen, mit Komma getrennt 
-' * @return Integer oder False 
-' * @example ​   If find_in_set("​d",​ "​a,​b,​c,​d"​) Then ... 
-' * @example ​   SELECT ... WEHRE find_in_set('​d',​ field1) 
-' */ 
-Public Function find_in_set(ByVal iSearch As String, ByVal iSet As String) As Variant 
- Dim parts() As String 
- Dim index   As Integer 
-On Error GoTo Err_Handler 
- find_in_set = False 
- parts = split(iSet, ","​) 
- For index = 0 To UBound(parts) 
- If Trim(parts(index)) = iSearch Then 
- find_in_set = index + 1 
- Exit For 
- End If 
- Next index 
- Exit Function 
-Err_Handler:​ 
- find_in_set = False 
 End Function End Function
 </​code>​ </​code>​
vba/functions/index.txt · Last modified: 29.06.2016 10:56:17 by yaslaw