home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / vbstra / vbstrapi.bas < prev    next >
BASIC Source File  |  1995-02-26  |  8KB  |  111 lines

  1. ' =========================================================================
  2. '
  3. '                                  %
  4. '      %%    %% %%%%%%            %%               %    %%%%%%  %%%%
  5. '      %%    %%  %%  %%           %%              %%%    %%  %%  %%
  6. '      %%    %%  %%  %%  %%%%%  %%%%%%  %% %%%   %% %%   %%  %%  %%
  7. '      %%    %%  %%%%%  %%   %%   %%     %%% %% %%   %%  %%  %%  %% v1.10
  8. '      %%    %%  %%  %%  %%%      %%     %%  %% %%%%%%%  %%%%%   %%
  9. '       %%  %%   %%  %%    %%%    %%     %%     %%   %%  %%      %%
  10. '        %%%%    %%  %% %%   %%   %% %%  %%     %%   %%  %%      %%
  11. '         %%    %%%%%%   %%%%%     %%%  %%%%    %%   %% %%%%    %%%%
  12. '
  13. '       A String Buffer and Huge String Array Object Server Library
  14. '            Written specifically for Visual Basic for Windows
  15. '
  16. '                     Copyright ⌐ 1995, Greg Truesdell
  17. '
  18. ' =========================================================================
  19. Option Explicit
  20.  
  21. ' =========================================================================
  22. ' = FindStringXX()                                                        =
  23. ' =     Optimizing string search function                                 =
  24. ' =                                                                       =
  25. ' = FindString()    is CASE SENSITIVE                                     =
  26. ' = FindStringIC()  is CASE INSENSITIVE                                   =
  27. ' =========================================================================
  28. '
  29. Declare Function FindString Lib "VBstrAPI.DLL" (ByVal Start As Integer, ByVal srcStr As String, ByVal targetStr As String) As Long
  30. Declare Function FindStringIC Lib "VBstrAPI.DLL" (ByVal Start As Integer, ByVal srcStr As String, ByVal targetStr As String) As Long
  31.  
  32. ' =========================================================================
  33. ' = CenterString()                                                        =
  34. ' =     Centers the <srcStr> string in spaces or char                     =
  35. ' =                                                                       =
  36. ' = CenterString()      centers the string in spaces                      =
  37. ' = CenterStringIn()    centers the string in characater                  =
  38. ' =========================================================================
  39. '
  40. Declare Function CenterString Lib "VBstrAPI.DLL" (ByVal srcStr As String, ByVal wide As Integer) As String
  41. Declare Function CenterStringIn Lib "VBstrAPI.DLL" (ByVal srcStr As String, ByVal char As String, ByVal wide As Integer) As String
  42.  
  43. ' =========================================================================
  44. ' = CopyFile()                                                            =
  45. ' =     Copies the source file to the new destination file                =
  46. ' =========================================================================
  47. '
  48.  
  49. '   CopyFile Error Codes
  50.     
  51. Global Const CF_SUCCESS = 0              ' Successful
  52. Global Const CF_SAME_ERROR = -1          ' Can't copy to same file
  53. Global Const CF_ATTR_ERROR_SRC = -2      ' source file attribute error
  54. Global Const CF_ATTR_ERROR_DEST = -3     ' destination file attribute error
  55. Global Const CF_OPEN_ERROR_SRC = -4      ' source file open error
  56. Global Const CF_OPEN_ERROR_DEST = -5     ' destination file open error
  57. Global Const CF_READ_ERROR = -6          ' source file read error
  58. Global Const CF_WRITE_ERROR = -7         ' destination file write error
  59. Global Const CF_CLOSE_ERROR = -8         ' destiation file close error
  60. Global Const CF_ATTR_ERROR = -9          ' general attribute error
  61. Global Const CF_FILE_INVALID = -10       ' source file is invalid
  62. Global Const CF_PATH_INVALID = -11       ' destination file is invalid
  63.  
  64. Declare Function CopyFile Lib "VBstrAPI.DLL" (ByVal srcFile As String, ByVal destFile As String) As Integer
  65.  
  66.  
  67. ' ====================================================================================
  68. ' =          Concatenation String Array Object Functions and Procedures              =
  69. ' ====================================================================================
  70. ' =                 See VBstrAPI.HLP for more information.                           =
  71. ' ====================================================================================
  72. Declare Function CreateNewCatString Lib "VBstrAPI.DLL" (ByVal cbSize As Long) As Integer
  73. Declare Sub DestroyCatString Lib "VBstrAPI.DLL" (ByVal SHandle As Integer)
  74. Declare Function CatStrLength Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  75. Declare Sub CatStrClear Lib "VBstrAPI.DLL" (ByVal SHandle As Integer)
  76. Declare Sub CatStrResetCLP Lib "VBstrAPI.DLL" (ByVal SHandle As Integer)
  77. Declare Function CatStrAdd Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal St As String) As Integer
  78. Declare Function CatStrAddLine Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal St As String) As Integer
  79. Declare Function CatStrNext Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal cbSize As Long, Status As Integer) As String
  80. Declare Function CatStrNextLine Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, Status As Integer) As String
  81. Declare Function CatStrCopy Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As String
  82. Declare Function CatStrMid$ Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Start As Long, ByVal cbSize As Long)
  83. Declare Function CatStrFind Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Start As Long, ByVal Target As String) As Long
  84. Declare Function CatStrFindIC Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Start As Long, ByVal Target As String) As Long
  85. Declare Sub CatStrSetCLP Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal NewCLP As Long)
  86. Declare Function CatStrLineCount Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  87. Declare Function CatStrLPSZ Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  88.  
  89. ' ====================================================================================
  90. ' =                Huge String Array Object Functions and Procedures                 =
  91. ' ====================================================================================
  92. ' =                 See VBstrAPI.HLP for more information.                           =
  93. ' ====================================================================================
  94. Declare Function CreateNewStringArray Lib "VBstrAPI.DLL" (ByVal cbItems As Long, ByVal cbSize As Long) As Integer
  95. Declare Sub DestroyStringArray Lib "VBstrAPI.DLL" (ByVal SHandle As Integer)
  96. Declare Function GetArrayStr Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long) As String
  97. Declare Function PutArrayStr Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long, ByVal St As String) As Integer
  98. Declare Function GetArrayNext Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As String
  99. Declare Function PutArrayNext Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal St As String) As Integer
  100. Declare Function DeleteArrayStr Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long) As Integer
  101. Declare Function InsertArrayStr Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long, ByVal St As String) As Integer
  102. Declare Function ArrayStrBufSize Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  103. Declare Function ArrayStrMemSize Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  104. Declare Function ArrayStrCLP Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  105. Declare Sub ArrayStrClear Lib "VBstrAPI.DLL" (ByVal SHandle As Integer)
  106. Declare Function ArrayStrElements Lib "VBstrAPI.DLL" (ByVal SHandle As Integer) As Long
  107. Declare Sub ArrayStrSetCLP Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long)
  108. Declare Function PutArrayBlk Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long, Block As Any, ByVal cbSize As Long) As Integer
  109. Declare Sub GetArrayBlk Lib "VBstrAPI.DLL" (ByVal SHandle As Integer, ByVal Element As Long, Block As Any, ByVal cbSize As Long)
  110.  
  111.