VB Extension Tools HTML project report
Project: CodeHelperCollection Module: GDefault

Basic information:

Module Type  Class module 
File  C:\Code\EE-projects\units\vb\ActiveX\CodeHelperCollection\src\GDefault.cls 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Move a (VB 6.0) form to the center of the screen. 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Move a (VB 6.0) form to the center of the screen. 
Author  Ralf Kunsmann 
Date  2001 05 14 
Purpose  Wrapper to several methodes of MDefault 
Requierements  Default.bas 
Author  Ralf Kunsmann 
Date  2002 06 13 
Purpose  This public class module mainly contains definitions for
User Defined Types (in 'C' one would say 'structures'). Why
are they declared in a public class module? Because this is
the only way we can move VB to accept UDTs as parameters of
public functions óæð¤. 

Procedures:

Class_Initialize
VERSION
CheckThousendSeperator
EventNotifier
CenterForm
TextMark
RefreshNow
GetProc
SaveWindowSettings
RestoreWindowSettings
VBGetPrivateProfileString
VBWritePrivateProfileString
VBWritePrivateProfileSection
VBGetPrivateProfileSectionNames
VBGetPrivateProfileSection
GetHorBorder
GetVerBorder
SetRecordsetCursor
ByteArrayToString
StringFixLen
EnumerateGrid
CheckBoolean
BuildCollectionFromDBTable
CreateCommandButton
CreateLabel
CreateControl
CreateGUID
CreateRUID
SetComboBoxItem
SetGridDataRangeBackColor
LibFuncAvailable
GetErrorInfo
GetFileList
AddSectionHeaderBrackets
DelSectionHeaderBrackets
Max
Min
GetSeps
id
POSU
GetStuk
GetStrukFromDB
SendStruk
IsYes
RemoveEmtyLinesAtEnd
MergeStringArray
BuildStartEndTages
DefaultStartTag
DefaultEndTag
GetTextRange
GetTextRangeEx
WordsWithUCasesToWords
WordsToUCaseUnderline
UCaseUnderlineToWords
WordsTo1stCharUCaseWord
LCasesFromWords1stChar
GetTextLine
AssignStringArray
MergeStringArrayEx
DisplayErrorMsg


Procedure 'Class_Initialize' List of procedures

Scope/Type  Private Sub 


Procedure 'VERSION' List of procedures

Scope/Type  Public Property (Get) 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Return a version string of current application. 


Procedure 'CheckThousendSeperator' List of procedures

Scope/Type  Public Function 
Code parameters  pfThousendSeparatorForbidden As Boolean
psInputCharacter As String
psThousendSep As String
psDecimalSep As String
psMessageBoxCaption As String 
Code return value  Boolean 
Author  Ralf Kunsmann 
Date  2004 09 13 
Purpose  Check, if user entered the character which is defined as
Digit Separator (Thousend Separator). 
Result  Boolean: True, if charater entered is valid, else False. 


Procedure 'EventNotifier' List of procedures

Scope/Type  Public Property (Get) 
Code return value  EventNotifier 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Return reference to an object of EventNotifier class. 


Procedure 'CenterForm' List of procedures

Scope/Type  Public Sub 
Code parameters  FormToHandle As Object 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Move a (VB 6.0) form to the center of the screen. 


Procedure 'TextMark' List of procedures

Scope/Type  Public Sub 
Code parameters  TextBoxToHandle As Object 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Select all the text in a TextBox-Control. 


Procedure 'RefreshNow' List of procedures

Scope/Type  Public Function 
Code parameters  ByVal Interval As Long
ByRef Last As Currency 
Code return value  Boolean 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Using 'timeGetTime', we check whether a given time interval
is run over. 


Procedure 'GetProc' List of procedures

Scope/Type  Public Function 
Code parameters  Proc As Long 
Code return value  Long 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Assign the address of a function to a variable. 
Sample  Debug.Print GetProc(AddressOf MyProc). 


Procedure 'SaveWindowSettings' List of procedures

Scope/Type  Public Sub 
Code parameters  FormToHandle As Object
Regi As String
Optional Name As String
Optional PositionOnly As Boolean = False 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Save the current size and position of a form to the
registry. Settings are saved to a subkey of
[HKEY_CURRENT_USER\Software\VB and VBA Program Settings] 


Procedure 'RestoreWindowSettings' List of procedures

Scope/Type  Public Sub 
Code parameters  FormToHandle As Object
Regi As String
Optional Name As String
Optional PositionOnly As Boolean = False 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Restore the size and position of a form from the registry.
Settings are read trom a subkey of
[HKEY_CURRENT_USER\Software\VB and VBA Program
Settings]. 
Hint  This is recommanded to be used with reverse function
SaveWindowSettings(). 


Procedure 'VBGetPrivateProfileString' List of procedures

Scope/Type  Public Function 
Code parameters  ByVal IniFile As String
ByVal Section As String
ByVal Entry As String
Optional ByVal Default As String = "" 
Code return value  String 


Procedure 'VBWritePrivateProfileString' List of procedures

Scope/Type  Public Function 
Code parameters  ByVal IniFile As String
ByVal Section As String
ByVal Entry As String
ByVal Value As String 
Code return value  Boolean 


Procedure 'VBWritePrivateProfileSection' List of procedures

Scope/Type  Public Function 
Code parameters  ByVal psIniFile As String
ByVal psSection As String
ByVal psValues As String 
Code return value  Boolean 


Procedure 'VBGetPrivateProfileSectionNames' List of procedures

Scope/Type  Public Function 
Code parameters  FileName As String 
Code return value  Variant 


Procedure 'VBGetPrivateProfileSection' List of procedures

Scope/Type  Public Function 
Code parameters  FileName As String
SectionName As String 
Code return value  Variant 


Procedure 'GetHorBorder' List of procedures

Scope/Type  Public Function 
Code parameters  FormToHandle As Object 
Code return value  Long 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Return with of horizonal border of a VB 6.0 form in Twips.
Horizonal border is meant to be difference btw. outer form
with and inner range of form. 


Procedure 'GetVerBorder' List of procedures

Scope/Type  Public Function 
Code parameters  FormToHandle As Object 
Code return value  Long 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Return with of vertical border of a VB 6.0 form in Twips.
Vertical orizonal border is meant to be difference btw.
outer form height and inner range of form (considering
caption). 


Procedure 'SetRecordsetCursor' List of procedures

Scope/Type  Public Function 
Code parameters  RecrodsetToHandle As dao.Recordset
Field As String
id As Long 
Code return value  Boolean 


Procedure 'ByteArrayToString' List of procedures

Scope/Type  Public Function 
Code parameters  bString 
Code return value  Byte 
Author  Ralf Kunsmann 
Date  2001 06 06 
Purpose  Converts as Byte array with string characters to VB String
data type. 


Procedure 'StringFixLen' List of procedures

Scope/Type  Public Function 
Code parameters  ByRef CurrentString As String
ByRef Length As Long
Optional FillUp As String = " " 
Code return value  String 
Author  Ralf Kunsmann 
Date  2001 06 12 
Purpose  Fill up or cut a string to the given length. 
Result  Modified string. 
In parameters  String to be checked. Given length. 


Procedure 'EnumerateGrid' List of procedures

Scope/Type  Public Sub 
Code parameters  GridControl As Object
StartRow As Long
Column As Long
Format As String 


Procedure 'CheckBoolean' List of procedures

Scope/Type  Public Function 
Code parameters  Value As String
Format As String 
Code return value  Boolean 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Check a boolean, formated as text is 'Yes', 'True' or 'On'. 


Procedure 'BuildCollectionFromDBTable' List of procedures

Scope/Type  Public Function 
Code parameters  LocalDataBase As Database
Table As String
KeyField As String
ValueField As String
Optional Criteria As String 
Code return value  Collection 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Build a collection object from a records of database table. 


Procedure 'CreateCommandButton' List of procedures

Scope/Type  Public Function 
Code parameters  FormToHandle As Object
Name As String
Text As String
Optional Left As Long = 0
Optional Top As Long = 0
Optional Width As Long = 1500
Optional Height As Long = 300 
Code return value  Object 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Create a Command Button and add it to a VB 6.0 form object
at run time. 


Procedure 'CreateLabel' List of procedures

Scope/Type  Public Function 
Code parameters  FormToHandle As Object
Name As String
Text As String
Optional Left As Long = 0
Optional Top As Long = 0
Optional Width As Long = 1500
Optional Height As Long = 270 
Code return value  Object 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Create a Label control and add it to a VB 6.0 form object at
run time. 


Procedure 'CreateControl' List of procedures

Scope/Type  Public Function 
Code parameters  FormToHandle As Object
ControlType As String
Name As String
Left As Long
Top As Long
Width As Long
Height As Long 
Code return value  Object 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Create a control and add it to a VB 6.0 form object at run
time. 


Procedure 'CreateGUID' List of procedures

Scope/Type  Public Function 
Code return value  String 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Create a (of course) new Global Unified Identifier. 


Procedure 'CreateRUID' List of procedures

Scope/Type  Public Function 
Code return value  String 
Author  Ralf Kunsmann 
Date  2009-03-07 
Purpose  Create a (of course) new Readable Unified Identifier. What
the heck is a RUID? It's somewhat like a GUID, with less
guarantee for uniqueness, but much easier to read for humans. 


Procedure 'SetComboBoxItem' List of procedures

Scope/Type  Public Sub 
Code parameters  ComboBoxControl As Object
Item As Variant
Optional ForceString As Boolean 


Procedure 'SetGridDataRangeBackColor' List of procedures

Scope/Type  Public Sub 
Code parameters  GridControl As Object
Color As Long
Optional StartRow As Long
Optional EndRow As Long
Optional StartCol As Long
Optional EndCol As Long 


Procedure 'LibFuncAvailable' List of procedures

Scope/Type  Public Function 
Code parameters  Library As String
FunctionName As String 
Code return value  Boolean 


Procedure 'GetErrorInfo' List of procedures

Scope/Type  Public Function 
Code parameters  Err As ErrObject 
Code return value  String 


Procedure 'GetFileList' List of procedures

Scope/Type  Public Function 
Code parameters  Path As String
Files As Collection 
Code return value  Boolean 


Procedure 'AddSectionHeaderBrackets' List of procedures

Scope/Type  Public Function 
Code parameters  ByVal psSectionHeader As String 
Code return value  String 
Author  Ralf Kunsmann 
Date  2001 03 29 
Purpose  Adds brackets for a ini file section header.
E.g. EMM386 --> [EMM386]. 
Result  String. 
In parameters  String. 


Procedure 'DelSectionHeaderBrackets' List of procedures

Scope/Type  Public Function 
Code parameters  ByVal psSectionHeader As String 
Code return value  String 
Author  Ralf Kunsmann 
Date  2001 03 29 
Purpose  Delete brackets from a ini file section header.
E.g. [EMM386] --> EMM386. 
Result  String. 
In parameters  String. 


Procedure 'Max' List of procedures

Scope/Type  Public Function 
Code parameters  r1 As Double
r2 As Double 
Code return value  Double 
Author  Ralf Kunsmann 
Date  2003 10 15 
Purpose  Return the maximum of two given numbers. 
Result  Double 


Procedure 'Min' List of procedures

Scope/Type  Public Function 
Code parameters  r1 As Double
r2 As Double 
Code return value  Double 
Author  Ralf Kunsmann 
Date  2003 10 15 
Purpose  Return the minimum of two given numbers. 
Result  Double 


Procedure 'GetSeps' List of procedures

Scope/Type  Public Sub 
Code parameters  ByRef psThousendSep As String
ByRef psDecimalSep As String 
Author  Ralf Kunsmann 
Date  2002 03 22 
Purpose  Get separators for digit grouping and decimal digits. 


Procedure 'id' List of procedures

Scope/Type  Public Sub 


Procedure 'POSU' List of procedures

Scope/Type  Public Sub 


Procedure 'GetStuk' List of procedures

Scope/Type  Public Sub 


Procedure 'GetStrukFromDB' List of procedures

Scope/Type  Public Sub 


Procedure 'SendStruk' List of procedures

Scope/Type  Public Sub 


Procedure 'IsYes' List of procedures

Scope/Type  Public Function 
Code parameters  psString As String 
Code return value  Boolean 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Return True, if LCase of the In Parameter contains
"y", "yes", "j", "ja" or "1". 


Procedure 'RemoveEmtyLinesAtEnd' List of procedures

Scope/Type  Public Sub 
Code parameters  psCode 
Code return value  String) 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Remove emty lines at the end of an array of strings. 
In parameters  String psCode(): Array of strings. 
Out parameters  dto. 


Procedure 'MergeStringArray' List of procedures

Scope/Type  Public Function 
Code parameters  psStringsToAdd As String
psCurrentStrings 
Code return value  String, psNewStrings( 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Merge a string array with some strings to add to a new
string array. 
Result  True on success, else False 
In parameters  String psStringsToAdd: Some lines of text separated by vbCrLf.
String psCurrentStrings(): Array of strings.
Long piStartLine: Line no. in psCurrentStrings where new string
                  are startet to fill in.
Long piEndLine: Line no. in psCurrentStrings from where on
                fill up from psCurrentStrings is continued. 
Out parameters  String psNewStrings(): The merged strings 


Procedure 'BuildStartEndTages' List of procedures

Scope/Type  Public Sub 
Code parameters  psTagPart As String
psStartTag As String
psEndTag As String
Optional psCommentTag As String = "// " 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  This is a very special feature in the context of generating
code for the NGE GUI from the corresponding Excel file
(current name of this file is CAN Datenformate.xls - but
this might change). 
In parameters  String (psTagPart): Part of the tag, which is special and
                    will be added to default strings for
                    stard and end tag. 
Out parameters  String (psStartTag): The build start tag
String (psEndTag): The build end tag 


Procedure 'DefaultStartTag' List of procedures

Scope/Type  Public Function 
Code return value  String 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Return the default start tag, which is used by
'BuildStartEndTags()'. 


Procedure 'DefaultEndTag' List of procedures

Scope/Type  Public Function 
Code return value  String 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Return the default End tag, which is used by
'BuildStartEndTags()'. 


Procedure 'GetTextRange' List of procedures

Scope/Type  Public Function 
Code parameters  psText 
Code return value  String, psStartTag As String, psEndTag As String, piStartLine As Long, piEndLine As Long 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Get start and end line number of a range within an array of
strings which is specified by a pair of tags. 
Result  Boolean: True on success, else False 


Procedure 'GetTextRangeEx' List of procedures

Scope/Type  Public Function 
Code parameters  psText 
Code return value  String, psStartTag As String, psEndTag As String, piStartLine As Long, piEndLine As Long, Optional pfCompareExcact As Boolean = False 
Author  Ralf Kunsmann 
Date  2005 01 20 
Purpose  Get start and end line number of a range within an array of
strings which is specified by a pair of tags. 
Result  Boolean: True on success, else False 


Procedure 'WordsWithUCasesToWords' List of procedures

Scope/Type  Public Function 
Code parameters  ps As String 
Code return value  String 


Procedure 'WordsToUCaseUnderline' List of procedures

Scope/Type  Public Function 
Code parameters  ps As String 
Code return value  String 


Procedure 'UCaseUnderlineToWords' List of procedures

Scope/Type  Public Function 
Code parameters  ps As String 
Code return value  String 


Procedure 'WordsTo1stCharUCaseWord' List of procedures

Scope/Type  Public Function 
Code parameters  ps As String 
Code return value  String 


Procedure 'LCasesFromWords1stChar' List of procedures

Scope/Type  Public Function 
Code parameters  ps As String 
Code return value  String 


Procedure 'GetTextLine' List of procedures

Scope/Type  Public Function 
Code parameters  psText 
Code return value  String,psTag As String 
Author  Ralf Kunsmann 
Date  2005 01 24 
Purpose  Get line number of a range within an array of strings which
is specified by a tag. 
Result  Long: Zero means 'Not found', else Line Number 


Procedure 'AssignStringArray' List of procedures

Scope/Type  Public Function 
Code parameters  psSource 
Code return value  String, psTarget( 
Author  Ralf Kunsmann 
Date  2006 05 13 
Purpose  Assign strings of one string array to another. 


Procedure 'MergeStringArrayEx' List of procedures

Scope/Type  Public Sub 
Code parameters  psToAdd As String
psCurrent 
Code return value  String, psNew( 
Author  Ralf Kunsmann 
Date  2006 05 13 
Purpose  Merge a string to a certain position of a target string
(array) and removes emty lines as end of array. 


Procedure 'DisplayErrorMsg' List of procedures

Scope/Type  Public Sub 
Code parameters  Description As String
ErrNumber As Long
ErrDescription As String
ModuleName As String
ProcedureName As String
Optional ErrorLine As Long = 0 


Reporting date and time: 2009 03 07, 21:41:41 (year month day, hour:minute:second [24 hour format])