Changeset 268 for Include/Classes/System/String.ab
- Timestamp:
- Jun 2, 2007, 7:04:19 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/String.ab
r253 r268 216 216 Sub ReSize(allocLength As Long) 217 217 If allocLength < 0 Then Exit Sub 218 If allocLength > m_Length Then 219 Dim oldLength As Long 220 oldLength = m_Length 221 If AllocStringBuffer(allocLength) <> 0 Then 218 Dim oldLength = m_Length 219 If AllocStringBuffer(allocLength) <> 0 Then 220 If allocLength > oldLength Then 222 221 ZeroMemory(VarPtr(Chars[oldLength]), SizeOf (StrChar) * (m_Length - oldLength + 1)) 222 Else 223 Chars[m_Length] = 0 223 224 End If 224 Else 225 m_Length = allocLength 225 End If 226 End Sub 227 228 Sub ReSize(allocLength As Long, c As StrChar) 229 If allocLength < 0 Then Exit Sub 230 Dim oldLength = m_Length 231 If AllocStringBuffer(allocLength) <> 0 Then 232 If allocLength > oldLength Then 233 _System_FillChar(VarPtr(Chars[oldLength]), (m_Length - oldLength) As SIZE_T, c) 234 End If 226 235 Chars[m_Length] = 0 227 236 End If 228 End Sub229 230 Sub ReSize(allocLength As Long, c As StrChar)231 If allocLength < 0 Then232 Exit Sub233 ElseIf allocLength > m_Length Then234 Dim oldLength As Long235 oldLength = m_Length236 If AllocStringBuffer(allocLength) <> 0 Then237 Dim p = VarPtr(Chars[oldLength]) As *StrChar238 Dim fillLen = m_Length - oldLength239 Dim i As Long240 For i = 0 To ELM(fillLen)241 p[i] = c242 Next243 End If244 Else245 m_Length = allocLength246 End If247 Chars[m_Length] = 0248 237 End Sub 249 238
Note:
See TracChangeset
for help on using the changeset viewer.