Advertisement
jargon

basMKxCVx32.bas

Feb 23rd, 2013
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Attribute VB_Name = "basMKxCVx32"
  2. #If Win32 Then
  3.   Public Declare Sub HMemCpy Lib "kernel32" Alias _
  4.       "RtlMoveMemory" (Destination As Any, Source As Any, _
  5.       ByVal Length As Long)
  6. #Else
  7.   Declare Sub HMemCpy Lib "kernel" (hpvDest As Any, _
  8.       hpvSource As Any, ByVal cbCopy As Long)
  9. #End If
  10. ' the realization of the functions of CVx/MKx$ with the aid of the turning to
  11. ' to the functions Of shindoshs API.  HmemCpy or RtlMoveMemory
  12. ' (copying the given number of bytes of one region
  13. ' memory into another)
  14. '
  15. ' NOTE.  The transfer of line variable in terms of the value
  16. ' (ByVal) means that to the function Of yuMemChpy is transferred
  17. ' the address not of describer, but line itself
  18. ' Funchtion of ccVD(x$) ace To double Of yuMemChpy rate #, ByVal x$, 8 CHCVcD = the rate # Of end Of funchtion
  19.  
  20. Public Function CVD(x$) As Double
  21.    HMemCpy Temp#, ByVal x$, 8
  22.    CVD = Temp#
  23. End Function
  24. Public Function CVI(x$) As Integer
  25.    HMemCpy Temp%, ByVal x$, 2
  26.    CVI = Temp%
  27. End Function
  28. Public Function CVL(x$) As Long
  29.    HMemCpy Temp&, ByVal x$, 4
  30.    CVL = Temp&
  31. End Function
  32. Public Function CVS(x$) As Single
  33.    HMemCpy Temp!, ByVal x$, 4
  34.    CVS = Temp!
  35. End Function
  36. Public Function MKD$(x#)
  37.    Dim Temp As String * 8
  38.    HMemCpy ByVal Temp, x#, 8
  39.    MKD$ = Temp
  40. End Function
  41. Public Function MKI$(x%)
  42.    Dim Temp As String * 2
  43.    HMemCpy ByVal Temp, x%, 2
  44.    MKI$ = Temp
  45. End Function
  46. Public Function MKL$(x&)
  47.    Dim Temp As String * 4
  48.    HMemCpy ByVal Temp, x&, 4
  49.    MKL$ = Temp
  50. End Function
  51. Public Function MKS$(x!)
  52.    Dim Temp As String * 4
  53.    HMemCpy ByVal Temp, x!, 4
  54.    MKS$ = Temp
  55. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement