home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / LPAS / YG604W95.ZIP / VBASIC4.TXT < prev    next >
Text File  |  1996-10-09  |  1KB  |  35 lines

  1. For the Windows programmer using Visual Basic 4.0
  2. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  3.  
  4. For the users of a Power Engine (YGrep Search Engine or BitList Engine),
  5. it is important to notice that when used with a Visual Basic integrated
  6. environement, the DLL interface file is YGREP32.BAS (resp. BITLIS32.BAS).
  7.  
  8. This file must be copied in the GLOBALS of your project. It will declare
  9. all functions that can be used with Visual Basic 4.0.
  10.  
  11. Furthermore, you should remember that handling strings coming from a DLL
  12. written in C language may be somewhat surprising to you (in the only
  13. case that a function returns a String).
  14.  
  15. You should use the following pattern when you want to put the returned
  16. string out of function AFunctionReturningACString() into the RetStr$
  17. string variable.
  18.  
  19.  
  20. Dim RetStr$
  21. RetStr$ = String$(1024,0)    '1024 or any number larger than the number of chars in the returned value
  22. RetStr$ = AFunctionReturningACString()
  23.  
  24. n = InStr(RetStr$, Chr$(0))  ' find first null character
  25. If n Then
  26.     s = Left$(RetStr$, n - 1)
  27. End If
  28.  
  29. Label2.Caption = RetStr$    'use the returned string as appropriate
  30.  
  31.  
  32. This snippet of code should help you in finding the way you should write
  33. any other type of VB4 code which needs to access a function returning a
  34. string like SFileRGrep() or most of the YString Engine functions.
  35.