Changeset 497 for trunk/Include/basic/command.sbp
- Timestamp:
- Mar 28, 2008, 5:43:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/basic/command.sbp
r478 r497 1 1 'command.sbp 2 3 4 #ifndef _INC_COMMAND5 #define _INC_COMMAND6 2 7 3 Const _System_Type_SByte = 1 … … 152 148 Sub INPUT_FromFile(FileNumber As Long) 153 149 FileNumber-- 154 150 155 151 Dim i = 0 As Long 156 152 Dim buffer = New System.Text.StringBuilder(256) 157 Dim temp[1] As StrChar153 Dim temp[1] As Char 158 154 Dim dwAccessBytes As DWord 159 155 Dim IsStr As Long … … 162 158 '次のデータをサーチ 163 159 Do 164 Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf ( StrChar),VarPtr(dwAccessBytes),ByVal 0)160 Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0) 165 161 If ret=0 or dwAccessBytes=0 Then 166 162 'error … … 173 169 IsStr=0 174 170 While 1 175 Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf ( StrChar),VarPtr(dwAccessBytes),ByVal 0)171 Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0) 176 172 If ret = 0 or dwAccessBytes = 0 Then 177 173 'error … … 183 179 If dwAccessBytes=0 or temp[0]=0 or temp[0]=13 or temp[0]=10 or (IsStr=0 and temp[0]=Asc(",")) or (IsStr=0 and (temp[0]=32 or temp[0]=9) and _System_InputDataType[i]<>_System_Type_String) Then 184 180 If temp[0]=13 Then 185 ReadFile(_System_hFile[FileNumber],temp,SizeOf ( StrChar),VarPtr(dwAccessBytes),ByVal 0)181 ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0) 186 182 If Not(dwAccessBytes<>0 And temp[0]=10) Then 187 183 SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT) … … 202 198 End If 203 199 204 buffer.Append(0 As StrChar)200 buffer.Append(0 As Char) 205 201 Exit While 206 202 End If … … 252 248 Function _System_GetUsingFormat(UsingStr As String) As String 253 249 Dim i2 As Long, i3 As Long, i4 As Long, i5 As Long, ParmNum As Long 254 Dim temporary[255] As StrChar250 Dim temporary[255] As Char 255 251 Dim buffer = New System.Text.StringBuilder(1024) 256 252 … … 270 266 If UsingStr[i2]=Asc("#") Then 271 267 Dim dec As Long, sign As Long 272 Dim temp2 As * StrChar268 Dim temp2 As *Char 273 269 274 270 Dim length_num As Long, length_buf As Long … … 325 321 326 322 If dec > 0 Then 327 memcpy(VarPtr(buffer.Chars[i3]), temp2, SizeOf ( StrChar) * length_num)323 memcpy(VarPtr(buffer.Chars[i3]), temp2, SizeOf (Char) * length_num) 328 324 Else 329 325 buffer[i3] = &H30 … … 376 372 ActiveBasic.Strings.Detail.ChrFill(VarPtr(buffer.Chars[i3]), i4, &h20) 'Asc(" ") 377 373 End If 378 memcpy(VarPtr(buffer.Chars[i3]), _System_UsingStrData[ParmNum], SizeOf ( StrChar) * i5)374 memcpy(VarPtr(buffer.Chars[i3]), _System_UsingStrData[ParmNum], SizeOf (Char) * i5) 379 375 i3 += i4 380 376 Else … … 416 412 RecodeNumber-- 417 413 418 SetFilePointer(_System_hFile(FileNumber), SizeOf ( StrChar) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN)414 SetFilePointer(_System_hFile(FileNumber), SizeOf (Char) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN) 419 415 Dim t = ZeroString(_System_FieldSize(FileNumber)) 420 ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf ( StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)416 ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (Char) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0) 421 417 If dwAccessByte = _System_FieldSize(FileNumber) Then 422 418 buffer = t.ToString … … 431 427 RecodeNumber-- 432 428 433 SetFilePointer(_System_hFile(FileNumber), SizeOf ( StrChar) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN)434 WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf ( StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)429 SetFilePointer(_System_hFile(FileNumber), SizeOf (Char) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN) 430 WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (Char) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0) 435 431 End Macro 436 432 … … 444 440 DeleteFile(ToTCStr(path)) 445 441 End Macro 446 447 448 #endif '_INC_COMMAND
Note:
See TracChangeset
for help on using the changeset viewer.