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 [11.03.2014 11:11:02]
yaslaw [concat_ws()]
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=ns,​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 46: Line 52:
  
  
-==== char2unicode() ==== 
-<code vb char2unicode.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' * 
-' * Wandelt ein Charakter in ein Unicode 
-' * @example: char2unicode("​€"​) -> '​\u20AC'​ 
-' * @param ​ String(1) ​  ​Charakter,​ der gewandelt werden soll 
-' * @return String ​     Unicode 
-' */ 
-Private Function char2Unicode(ByVal iChar As String) As String 
-    char2Unicode = Hex(AscW(iChar)) '​Hex-Wert ermitteln 
-    char2Unicode = "​\u"​ & String(4 - Len(char2Unicode),​ "​0"​) & char2Unicode 
-End Function 
-</​code>​ 
  
-==== unicode2char ==== 
-<code vb unicode2char.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' * 
-' * Wandelt ein Unicode in ein Charakter 
-' * @example: unicode2char("​\u20AC"​) -> '​\€'​ 
-' * @param ​ String ​     Unicode 
-' * @return String ​     Char 
-' */ 
-Private Function unicode2Char(ByVal iUnicode As String) As String 
-    unicode2Char = ChrW(replace(iUnicode,​ "​\u",​ "&​h"​)) 
-End Function 
-</​code>​ 
  
 ====replaceA()==== ====replaceA()====
 Mehrere Replace auf einmal ausführen Mehrere Replace auf einmal ausführen
-<code vb truncDate.bas>+<code vb replacea.bas>
 '/** '/**
 ' * Copyright mpl by ERB software | http://​wiki.yaslaw.info ' * Copyright mpl by ERB software | http://​wiki.yaslaw.info
Line 258: 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 
-'*/ 
-Public Function greatest(ParamArray items() As Variant) As Variant 
- Dim item As Variant 
- For Each item In items 
- If item > 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 
-'*/ 
-Public Function least(ParamArray items() As Variant) As Variant 
- Dim item As Variant 
- least = items(LBound(items)) 
- For Each item In items 
- If item < 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 359: 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>​
Line 432: Line 283:
 </​code>​ </​code>​
  
-====getActiveWinUser()==== 
-<code vb getActiveWinUser.bas>​ 
-'/** 
-' * Copyright mpl by ERB software | http://​wiki.yaslaw.info 
-' *  
-' * Gibt den aktuellen Windows-user zurück 
-' * @return <​String>​ 
-' */ 
-Public Function getActiveWinUser() 
- Dim objNet As Object 
-On Error Resume Next 
-  
- getActiveWinUser = "​NA"​ 
- Set objNet = CreateObject("​WScript.NetWork"​) 
- If Err.Number = 0 Then getActiveWinUser = objNet.UserName 
-  
- Set objNet = Nothing 
-End Function 
-</​code>​ 
  
 ====replaceUmlaute()==== ====replaceUmlaute()====
vba/functions/index.txt · Last modified: 29.06.2016 10:56:17 by yaslaw