Code |
AllocString01 |
Public Function AllocString01(ByVal lSize As Long) As String
AllocString01 = Space$(lSize)
End Function
|
AllocString02 |
Public Function AllocString02(ByVal lSize As Long) As String
AllocString02 = String$(lSize, 32)
End Function
|
AllocString03 |
Public Function AllocString03(ByVal lSize As Long) As String
AllocString03 = String$(lSize, " ")
End Function
|
AllocString04 |
Public Function AllocString04(ByVal lSize As Long) As String
' by Jory, jory@joryanick.com, 20011023
RtlMoveMemory ByVal VarPtr(AllocString04), _
SysAllocStringByteLen(0&, lSize + lSize), 4&
End Function
|
AllocString05 |
Public Function AllocString05(ByVal lSize As Long) As String
' by Donald, donald@xbeat.net, 20011027 (TLB by Guido)
AllocString05 = bstrapi.SysAllocStringLen(vbNullString, lSize)
End Function
|
AllocString06 |
Public Function AllocString06(ByVal lSize As Long) As String
' by Donald, donald@xbeat.net, 20011027 (TLB by Egbert)
AllocString06 = StringHelpers.SysAllocStringLen(ByVal 0&, lSize)
End Function
|
[05.inline] |
sRet = bstrapi.SysAllocStringLen(vbNullString, lSize)
|
[06.inline] |
sRet = StringHelpers.SysAllocStringLen(ByVal 0&, lSize)
|
Dope |
API
|
Private Declare Sub RtlMoveMemory Lib "kernel32" (dst As Any, src As Any, ByVal nBytes&)
Private Declare Function SysAllocStringByteLen& Lib "oleaut32" (ByVal olestr&, ByVal BLen&)
|
TLB
|
TLB StringHelpers (3KB, VB5-compatible. by Egbert Nierop)
TLB BStrAPI (2KB, VB5-compatible, by G.Beckmann)
|
Calls |
1 | sRet = AllocString(1)
|
2 | sRet = AllocString(100)
|
3 | sRet = AllocString(10000)
|
4 | sRet = AllocString(1000000)
|
Charts |