[1] | 1 | 'command.sbp
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | #ifndef _INC_COMMAND
|
---|
| 5 | #define _INC_COMMAND
|
---|
| 6 |
|
---|
| 7 |
|
---|
[119] | 8 | Const _System_Type_SByte = 1
|
---|
[89] | 9 | Const _System_Type_Byte = 2
|
---|
[1] | 10 | Const _System_Type_Integer = 3
|
---|
[89] | 11 | Const _System_Type_Word = 4
|
---|
| 12 | Const _System_Type_Long = 5
|
---|
| 13 | Const _System_Type_DWord = 6
|
---|
| 14 | Const _System_Type_Int64 = 7
|
---|
| 15 | Const _System_Type_QWord = 8
|
---|
[1] | 16 | Const _System_Type_Single = 9
|
---|
| 17 | Const _System_Type_Double = 10
|
---|
[119] | 18 | Const _System_Type_Char = 11
|
---|
| 19 | Const _System_Type_String = 13
|
---|
| 20 | Const _System_Type_VoidPtr = 14
|
---|
[1] | 21 | Const _System_MAX_PARMSNUM = 32-1
|
---|
| 22 |
|
---|
| 23 | Dim _System_DummyStr As String
|
---|
| 24 | Dim _System_DummyStr2 As String
|
---|
| 25 |
|
---|
| 26 | Macro BEEP()
|
---|
| 27 | MessageBeep(MB_OK)
|
---|
| 28 | End Macro
|
---|
| 29 |
|
---|
| 30 | Sub _System_Call_Destructor_of_GlobalObject() 'dummy
|
---|
| 31 | End Sub
|
---|
| 32 |
|
---|
| 33 | Macro END()
|
---|
| 34 | _System_Call_Destructor_of_GlobalObject()
|
---|
| 35 | ExitProcess(0)
|
---|
| 36 | End Macro
|
---|
| 37 |
|
---|
| 38 | Macro EXEC(lpFilePath As *Byte)(lpCmdLine As *Byte)
|
---|
[21] | 39 | ShellExecute(0,"open",lpFilePath,lpCmdLine,0,SW_SHOWNORMAL)
|
---|
[1] | 40 | End Macro
|
---|
| 41 |
|
---|
| 42 | Macro INPUT() 'dummy(INPUT_FromFile、INPUT_FromPromptを参照)
|
---|
| 43 | End Macro
|
---|
| 44 |
|
---|
| 45 | Macro PRINT() 'dummy(PRINT_ToFile、PRINT_ToPromptを参照)
|
---|
| 46 | End Macro
|
---|
| 47 |
|
---|
| 48 | Macro RANDOMIZE()
|
---|
| 49 | srand(GetTickCount())
|
---|
| 50 | End Macro
|
---|
| 51 |
|
---|
| 52 | Macro WRITE() 'dummy(PRINT_ToFile、PRINT_ToPromptを参照)
|
---|
| 53 | End Macro
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | '----------------
|
---|
| 57 | ' ウィンドウ関連
|
---|
| 58 | '----------------
|
---|
| 59 |
|
---|
[21] | 60 | Macro MSGBOX(hWnd As HWND, lpStr As String)(lpTitle As String, BoxType As DWord, ByRef retAns As DWord)
|
---|
[1] | 61 | If VarPtr(retAns) Then
|
---|
[21] | 62 | retAns=MessageBox(hWnd,lpStr,lpTitle,BoxType)
|
---|
[1] | 63 | Else
|
---|
[21] | 64 | MessageBox(hWnd,lpStr,lpTitle,BoxType)
|
---|
[1] | 65 | End If
|
---|
| 66 | End Macro
|
---|
| 67 |
|
---|
[89] | 68 | Macro WINDOW(ByRef hWnd As HWND, hOwner As HWND, x As Long, y As Long, nWidth As Long, nHeight As Long, lpTitle As String, dwStyle As DWord)(lpClass As String, id As HMENU, lpFunc As DWord, dwExStyle As DWord)
|
---|
[1] | 69 | If VarPtr(hWnd) Then
|
---|
[21] | 70 | hWnd=CreateWindowEx(dwExStyle,lpClass,lpTitle,dwStyle,x,y,nWidth,nHeight,hOwner,id,GetModuleHandle(0),NULL)
|
---|
[1] | 71 | Else
|
---|
[21] | 72 | CreateWindowEx(dwExStyle,lpClass,lpTitle,dwStyle,x,y,nWidth,nHeight,hOwner,id,GetModuleHandle(0),NULL)
|
---|
[1] | 73 | End If
|
---|
| 74 | End Macro
|
---|
| 75 |
|
---|
| 76 | Macro DELWND(hWnd As HWND)
|
---|
| 77 | DestroyWindow(hWnd)
|
---|
| 78 | End Macro
|
---|
| 79 |
|
---|
[21] | 80 | Macro INSMENU(hMenu As HMENU, PosID As Long, flag As Long)(lpString As String, id As Long, hSubMenu As HMENU, state As Long)
|
---|
[1] | 81 | Dim mii As MENUITEMINFO
|
---|
[123] | 82 | ZeroMemory(VarPtr(mii), Len(mii))
|
---|
| 83 | With mii
|
---|
| 84 | .cbSize = Len(mii)
|
---|
| 85 | .fMask = MIIM_TYPE
|
---|
[1] | 86 |
|
---|
[123] | 87 | If lpString.Length = 0 Then
|
---|
| 88 | mii.fType = MFT_SEPARATOR
|
---|
| 89 | Else
|
---|
| 90 | .fType = MFT_STRING
|
---|
| 91 | .fMask = .fMask or MIIM_STATE or MIIM_ID
|
---|
| 92 | .dwTypeData = StrPtr(lpString)
|
---|
| 93 | .wID = id
|
---|
| 94 | If hSubMenu Then
|
---|
| 95 | .fMask = .fMask or MIIM_SUBMENU
|
---|
| 96 | .hSubMenu = hSubMenu
|
---|
| 97 | End If
|
---|
| 98 | .fState=state
|
---|
[1] | 99 | End If
|
---|
[123] | 100 | End With
|
---|
| 101 | InsertMenuItem(hMenu, PosID, flag, mii)
|
---|
[1] | 102 | End Macro
|
---|
| 103 |
|
---|
| 104 |
|
---|
| 105 | '--------------
|
---|
| 106 | ' ファイル関連
|
---|
| 107 | '--------------
|
---|
| 108 |
|
---|
[90] | 109 | Dim _System_hFile(255) As HANDLE
|
---|
[21] | 110 | Macro OPEN(lpFileName As String, AccessFor As Long, FileNumber As Long)
|
---|
[1] | 111 | Dim dwAccess As Long
|
---|
[90] | 112 | Dim bAppend = 0 As Long
|
---|
[1] | 113 | Dim dwCreationDisposition As Long
|
---|
| 114 |
|
---|
[90] | 115 | FileNumber--
|
---|
[1] | 116 |
|
---|
| 117 | Select Case AccessFor
|
---|
| 118 | Case 0
|
---|
| 119 | dwAccess=GENERIC_READ or GENERIC_WRITE
|
---|
| 120 | dwCreationDisposition=OPEN_ALWAYS
|
---|
| 121 | Case 1
|
---|
| 122 | dwAccess=GENERIC_READ
|
---|
| 123 | dwCreationDisposition=OPEN_EXISTING
|
---|
| 124 | Case 2
|
---|
| 125 | dwAccess=GENERIC_WRITE
|
---|
| 126 | dwCreationDisposition=CREATE_ALWAYS
|
---|
| 127 | Case 3
|
---|
| 128 | dwAccess=GENERIC_WRITE
|
---|
| 129 | dwCreationDisposition=OPEN_ALWAYS
|
---|
| 130 | bAppend=1
|
---|
| 131 | End Select
|
---|
| 132 |
|
---|
[21] | 133 | _System_hFile(FileNumber)=CreateFile(lpFileName,dwAccess,0,ByVal NULL,dwCreationDisposition,FILE_ATTRIBUTE_NORMAL,NULL)
|
---|
[1] | 134 |
|
---|
[21] | 135 | If bAppend Then SetFilePointer(_System_hFile(FileNumber),0,NULL,FILE_END)
|
---|
[1] | 136 | End Macro
|
---|
[90] | 137 |
|
---|
[1] | 138 | Macro CLOSE()(FileNumber As Long)
|
---|
[90] | 139 | FileNumber--
|
---|
[1] | 140 |
|
---|
| 141 | If _System_hFile(FileNumber) Then
|
---|
[21] | 142 | CloseHandle(_System_hFile(FileNumber))
|
---|
| 143 | _System_hFile(FileNumber)=0
|
---|
[1] | 144 | End If
|
---|
| 145 | End Macro
|
---|
| 146 |
|
---|
| 147 | 'INPUT Command Data
|
---|
| 148 | Dim _System_InputDataPtr[_System_MAX_PARMSNUM] As VoidPtr
|
---|
| 149 | Dim _System_InputDataType[_System_MAX_PARMSNUM] As DWord
|
---|
| 150 | Sub INPUT_FromFile(FileNumber As Long)
|
---|
[21] | 151 | Dim i As Long ,i2 As Long, i3 As Long
|
---|
[1] | 152 | Dim buffer As String
|
---|
[110] | 153 | Dim temp[1] As Char
|
---|
[1] | 154 | Dim dwAccessBytes As DWord
|
---|
| 155 | Dim IsStr As Long
|
---|
| 156 |
|
---|
[90] | 157 | FileNumber--
|
---|
[1] | 158 |
|
---|
| 159 | buffer=ZeroString(GetFileSize(_System_hFile[FileNumber],0))
|
---|
| 160 |
|
---|
| 161 | i=0
|
---|
| 162 | While 1
|
---|
| 163 | '次のデータをサーチ
|
---|
| 164 | Do
|
---|
| 165 | i2=ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0)
|
---|
| 166 | If i2=0 or dwAccessBytes=0 Then
|
---|
| 167 | 'error
|
---|
| 168 | Exit Macro
|
---|
| 169 | End If
|
---|
| 170 | Loop While temp[0]=32 or temp[0]=9
|
---|
| 171 | SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT)
|
---|
| 172 |
|
---|
| 173 | '読み込み
|
---|
| 174 | i3=-1
|
---|
| 175 | IsStr=0
|
---|
| 176 | While 1
|
---|
[90] | 177 | i3++
|
---|
[1] | 178 |
|
---|
| 179 | i2=ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0)
|
---|
| 180 | If i2=0 or (i3=0 and dwAccessBytes=0) Then
|
---|
| 181 | 'error
|
---|
| 182 | Exit Macro
|
---|
| 183 | End If
|
---|
| 184 | If temp[0]=34 Then IsStr=IsStr xor 1
|
---|
| 185 |
|
---|
| 186 | buffer[i3]=temp[0]
|
---|
| 187 | 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
|
---|
| 188 | If temp[0]=13 Then
|
---|
| 189 | ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0)
|
---|
| 190 | If Not(dwAccessBytes<>0 And temp[0]=10) Then
|
---|
| 191 | SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT)
|
---|
| 192 | Continue
|
---|
| 193 | End If
|
---|
| 194 | End If
|
---|
| 195 |
|
---|
| 196 | If temp[0]=32 or temp[0]=9 Then
|
---|
| 197 | While 1
|
---|
| 198 | ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0)
|
---|
| 199 | If dwAccessBytes=0 Then Exit While
|
---|
| 200 | If temp[0]=Asc(",") Then Exit While
|
---|
[21] | 201 | If Not(temp[0]=32 or temp[0]=9) Then
|
---|
[1] | 202 | SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT)
|
---|
| 203 | Exit While
|
---|
| 204 | End If
|
---|
| 205 | Wend
|
---|
| 206 | End If
|
---|
| 207 |
|
---|
| 208 | buffer[i3]=0
|
---|
| 209 | Exit While
|
---|
| 210 | End If
|
---|
| 211 | Wend
|
---|
| 212 |
|
---|
| 213 | 'データを変数に格納
|
---|
[121] | 214 | _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], buffer, i3)
|
---|
[1] | 215 |
|
---|
[21] | 216 |
|
---|
[121] | 217 | i++
|
---|
[1] | 218 | If _System_InputDataPtr[i]=0 Then Exit While
|
---|
| 219 | Wend
|
---|
| 220 | End Sub
|
---|
| 221 |
|
---|
[123] | 222 | Sub _System_Input_SetArgument(arg As VoidPtr, dataType As DWord, ByRef buf As String, bufLen As Long)
|
---|
[121] | 223 | Select Case dataType
|
---|
| 224 | Case _System_Type_Double
|
---|
| 225 | SetDouble(arg, Val(buf))
|
---|
| 226 | Case _System_Type_Single
|
---|
| 227 | SetSingle(arg, Val(buf))
|
---|
| 228 | Case _System_Type_Int64,_System_Type_QWord
|
---|
| 229 | SetQWord(arg, Val(buf))
|
---|
| 230 | Case _System_Type_Long,_System_Type_DWord
|
---|
| 231 | SetDWord(arg, Val(buf))
|
---|
| 232 | Case _System_Type_Integer,_System_Type_Word
|
---|
| 233 | SetWord(arg, Val(buf))
|
---|
| 234 | Case _System_Type_SByte,_System_Type_Byte
|
---|
| 235 | SetByte(arg, Val(buf))
|
---|
| 236 | Case _System_Type_Char
|
---|
| 237 | SetChar(arg, buf[0])
|
---|
| 238 | Case _System_Type_String
|
---|
| 239 | Dim pTempStr As *String
|
---|
| 240 | pTempStr = arg As *String
|
---|
| 241 | pTempStr->ReSize(bufLen)
|
---|
| 242 | memcpy(pTempStr->Chars, buf.Chars, SizeOf (Char) * pTempStr->Length)
|
---|
| 243 | pTempStr->Chars[pTempStr->Length] = 0
|
---|
| 244 | End Select
|
---|
[123] | 245 | End Sub
|
---|
[121] | 246 |
|
---|
[1] | 247 | Sub PRINT_ToFile(FileNumber As Long, buf As String)
|
---|
| 248 | Dim dwAccessByte As DWord
|
---|
[123] | 249 | FileNumber--
|
---|
[1] | 250 |
|
---|
| 251 | WriteFile(_System_hFile(FileNumber),buf,Len(buf),VarPtr(dwAccessByte),ByVal NULL)
|
---|
| 252 | End Sub
|
---|
| 253 |
|
---|
| 254 | Dim _System_UsingDblData[_System_MAX_PARMSNUM] As Double
|
---|
| 255 | Dim _System_UsingStrData[_System_MAX_PARMSNUM] As String
|
---|
| 256 | Dim _System_UsingDataType[_System_MAX_PARMSNUM] As DWord
|
---|
| 257 | Function _System_GetUsingFormat(UsingStr As String) As String
|
---|
| 258 | Dim i2 As Long, i3 As Long, i4 As Long, i5 As Long, ParmNum As Long
|
---|
[110] | 259 | Dim temporary[255] As Char
|
---|
[1] | 260 | Dim buffer As String
|
---|
| 261 |
|
---|
| 262 | buffer=ZeroString(1024)
|
---|
| 263 |
|
---|
| 264 | ParmNum=0
|
---|
| 265 | i2=0
|
---|
| 266 | While 1
|
---|
| 267 | While 1
|
---|
| 268 | If UsingStr[i2]=Asc("#") or UsingStr[i2]=Asc("@") or UsingStr[i2]=Asc("&") Then Exit While
|
---|
| 269 | buffer[i3]=UsingStr[i2]
|
---|
| 270 | If UsingStr[i2]=0 Then Exit While
|
---|
[90] | 271 | i2++
|
---|
| 272 | i3++
|
---|
[1] | 273 | Wend
|
---|
| 274 |
|
---|
| 275 | If UsingStr[i2]=0 Then Exit While
|
---|
| 276 |
|
---|
| 277 | If UsingStr[i2]=Asc("#") Then
|
---|
| 278 | Dim dec As Long, sign As Long
|
---|
[110] | 279 | Dim temp2 As *Char
|
---|
[1] | 280 |
|
---|
| 281 | Dim length_num As Long, length_buf As Long
|
---|
[21] | 282 | Dim dblRoundOff=0 As Double
|
---|
[1] | 283 |
|
---|
| 284 |
|
---|
| 285 | '----------------------
|
---|
| 286 | ' 四捨五入を考慮
|
---|
| 287 | '----------------------
|
---|
| 288 |
|
---|
| 289 | i4=i2
|
---|
| 290 | While UsingStr[i4]=Asc("#")
|
---|
[90] | 291 | i4++
|
---|
[1] | 292 | Wend
|
---|
| 293 | If UsingStr[i4]=Asc(".") Then
|
---|
[90] | 294 | i4++
|
---|
[1] | 295 |
|
---|
| 296 | dblRoundOff=0.5
|
---|
| 297 | While UsingStr[i4]=Asc("#")
|
---|
[90] | 298 | i4++
|
---|
| 299 | dblRoundOff /= 10
|
---|
[1] | 300 | Wend
|
---|
| 301 | End If
|
---|
| 302 |
|
---|
| 303 |
|
---|
| 304 | '浮動小数点を文字列に変換
|
---|
| 305 | temp2=_ecvt(_System_UsingDblData[ParmNum]+dblRoundOff,15,dec,sign)
|
---|
| 306 |
|
---|
| 307 | '整数部
|
---|
| 308 | length_num=dec
|
---|
| 309 | If length_num<=0 Then length_num=1
|
---|
| 310 |
|
---|
| 311 | '符号が有る場合は、一文字分のスペースを考慮する
|
---|
[90] | 312 | If sign Then length_num++
|
---|
[1] | 313 |
|
---|
| 314 | length_buf=0
|
---|
| 315 | Do
|
---|
[90] | 316 | i2++
|
---|
| 317 | length_buf++
|
---|
[1] | 318 | Loop While UsingStr[i2]=Asc("#")
|
---|
| 319 |
|
---|
| 320 | If length_buf>=length_num Then
|
---|
| 321 | '通常時
|
---|
[123] | 322 | _System_FillChar(VarPtr(buffer[i3]), length_buf - length_num, &h20) 'Asc(" ")
|
---|
| 323 |
|
---|
[90] | 324 | i3 += length_buf - length_num
|
---|
[1] | 325 |
|
---|
| 326 | If sign Then
|
---|
[123] | 327 | buffer[i3] = Asc("-")
|
---|
[90] | 328 | i3++
|
---|
[1] | 329 |
|
---|
[90] | 330 | length_num--
|
---|
[1] | 331 | End If
|
---|
| 332 |
|
---|
[123] | 333 | If dec > 0 Then
|
---|
| 334 | memcpy(VarPtr(buffer[i3]), temp2, SizeOf (Char) * length_num)
|
---|
[1] | 335 | Else
|
---|
[123] | 336 | buffer[i3] = &H30
|
---|
[1] | 337 | End If
|
---|
| 338 |
|
---|
[90] | 339 | i3 += length_num
|
---|
[1] | 340 | Else
|
---|
| 341 | '表示桁が足りないとき
|
---|
[123] | 342 | _System_FillChar(VarPtr(buffer[i3]), length_buf,&h23) 'Asc("#")
|
---|
[90] | 343 | i3 += length_buf
|
---|
[1] | 344 | End If
|
---|
| 345 |
|
---|
[123] | 346 | If UsingStr[i2] = Asc(".") Then
|
---|
| 347 | buffer[i3] = UsingStr[i2]
|
---|
[90] | 348 | i2++
|
---|
| 349 | i3++
|
---|
[1] | 350 |
|
---|
| 351 | i4=dec
|
---|
[123] | 352 | While UsingStr[i2] = Asc("#")
|
---|
[1] | 353 | If i4<0 Then
|
---|
| 354 | buffer[i3]=&H30
|
---|
| 355 | Else
|
---|
| 356 | buffer[i3]=temp2[i4]
|
---|
| 357 | End If
|
---|
[90] | 358 | i3++
|
---|
| 359 | i4++
|
---|
[1] | 360 |
|
---|
[90] | 361 | i2++
|
---|
[1] | 362 | Wend
|
---|
| 363 | End If
|
---|
| 364 | ElseIf UsingStr[i2]=Asc("@") Then
|
---|
[90] | 365 | i2++
|
---|
[1] | 366 |
|
---|
[123] | 367 | 'lstrcat(StrPtr(buffer)+i3,_System_UsingStrData[ParmNum])
|
---|
| 368 | memcpy(VarPtr(buffer[i3 + lstrlen(VarPtr(buffer[i3]))]), _System_UsingStrData[ParmNum], _
|
---|
| 369 | SizeOf (Char) * lstrlen(_System_UsingStrData[ParmNum]))
|
---|
| 370 | i3 += lstrlen(_System_UsingStrData[ParmNum])
|
---|
[1] | 371 | ElseIf UsingStr[i2]=Asc("&") Then
|
---|
| 372 | i4=0
|
---|
| 373 | Do
|
---|
[90] | 374 | i4++
|
---|
| 375 | i2++
|
---|
[1] | 376 | Loop While UsingStr[i2]=Asc(" ")
|
---|
| 377 |
|
---|
| 378 | If UsingStr[i2]=Asc("&") Then
|
---|
[90] | 379 | i4++
|
---|
| 380 | i2++
|
---|
[1] | 381 | i5=lstrlen(_System_UsingStrData[ParmNum])
|
---|
| 382 | If i4<=i5 Then
|
---|
| 383 | i5=i4
|
---|
| 384 | Else
|
---|
[123] | 385 | _System_FillChar(VarPtr(buffer[i3]), i4, &h20) 'Asc(" ")
|
---|
[1] | 386 | End If
|
---|
[123] | 387 | memcpy(VarPtr(buffer[i3]), _System_UsingStrData[ParmNum], SizeOf (Char) * i5)
|
---|
[90] | 388 | i3 += i4
|
---|
[1] | 389 | Else
|
---|
[90] | 390 | i2 -= i4
|
---|
[123] | 391 | buffer[i3] = Asc("&")
|
---|
[90] | 392 | i2++
|
---|
| 393 | i3++
|
---|
[1] | 394 | Continue
|
---|
| 395 | End If
|
---|
| 396 | End If
|
---|
| 397 |
|
---|
[90] | 398 | ParmNum++
|
---|
[1] | 399 | Wend
|
---|
| 400 |
|
---|
[123] | 401 | _System_GetUsingFormat = Left$(buffer, lstrlen(buffer))
|
---|
[1] | 402 | End Function
|
---|
| 403 | Sub PRINTUSING_ToFile(FileNumber As Long, UsingStr As String)
|
---|
| 404 | Dim dwAccessByte As DWord
|
---|
| 405 | Dim buf As String
|
---|
| 406 |
|
---|
[90] | 407 | FileNumber--
|
---|
[1] | 408 | buf=_System_GetUsingFormat(UsingStr)
|
---|
| 409 |
|
---|
| 410 | WriteFile(_System_hFile(FileNumber),buf,Len(buf),VarPtr(dwAccessByte),ByVal NULL)
|
---|
| 411 | End Sub
|
---|
| 412 |
|
---|
| 413 | Dim _System_FieldSize(255) As Long
|
---|
| 414 | Macro FIELD(FileNumber As Long, FieldSize As Long)
|
---|
[90] | 415 | FileNumber--
|
---|
[1] | 416 |
|
---|
| 417 | _System_FieldSize(FileNumber)=FieldSize
|
---|
| 418 | End Macro
|
---|
| 419 | Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)
|
---|
| 420 | Dim dwAccessByte As Long
|
---|
| 421 |
|
---|
[90] | 422 | FileNumber--
|
---|
| 423 | RecodeNumber--
|
---|
[1] | 424 |
|
---|
| 425 | SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN)
|
---|
| 426 | lpBuffer=ZeroString(_System_FieldSize(FileNumber))
|
---|
| 427 | ReadFile(_System_hFile(FileNumber),StrPtr(lpBuffer),_System_FieldSize(FileNumber),VarPtr(dwAccessByte),ByVal NULL)
|
---|
| 428 | If Not dwAccessByte=_System_FieldSize(FileNumber) Then
|
---|
| 429 | lpBuffer=Left$(lpBuffer,dwAccessByte)
|
---|
| 430 | End If
|
---|
| 431 | End Macro
|
---|
| 432 | Macro PUT(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)
|
---|
| 433 | Dim dwAccessByte As Long
|
---|
| 434 |
|
---|
[90] | 435 | FileNumber--
|
---|
| 436 | RecodeNumber--
|
---|
[1] | 437 |
|
---|
| 438 | SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN)
|
---|
| 439 | WriteFile(_System_hFile(FileNumber),StrPtr(lpBuffer),_System_FieldSize(FileNumber),VarPtr(dwAccessByte),ByVal NULL)
|
---|
| 440 | End Macro
|
---|
| 441 |
|
---|
[21] | 442 | Macro CHDIR(path As String)
|
---|
[1] | 443 | SetCurrentDirectory(path)
|
---|
| 444 | End Macro
|
---|
[21] | 445 | Macro MKDIR(path As String)
|
---|
[90] | 446 | CreateDirectory(path, 0)
|
---|
[1] | 447 | End Macro
|
---|
[21] | 448 | Macro KILL(path As String)
|
---|
[1] | 449 | DeleteFile(path)
|
---|
| 450 | End Macro
|
---|
| 451 |
|
---|
| 452 |
|
---|
| 453 | #endif '_INC_COMMAND
|
---|