Changeset 272 for Include/basic/dos_console.sbp
- Timestamp:
- Jun 12, 2007, 7:24:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/basic/dos_console.sbp
r268 r272 8 8 9 9 #include <api_console.sbp> 10 #include <Classes/ActiveBasic/Strings/Strings.ab> 10 11 11 12 Dim _System_hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE) … … 17 18 '--------------------------------------------- 18 19 Sub INPUT_FromPrompt(ShowStr As String) 19 Dim i As Long, i2 As Long, i3 As Long20 Dim buf As String21 20 Dim InputBuf[1023] As TCHAR 22 21 Dim dwAccessBytes As DWord … … 30 29 If InputBuf[dwAccessBytes-2] = &h0d And InputBuf[dwAccessBytes-1] = &h0a Then 31 30 InputBuf[dwAccessBytes-2] = 0 31 dwAccessBytes -= 2 32 32 End If 33 Dim InputStr As String(InputBuf) 33 34 If dwAccessBytes = 0 Then Goto *InputReStart 34 35 35 36 'データを変数に格納 36 i=0 37 i2=0 38 buf.ReSize(lstrlen(InputStr) + 1, 0) 39 Dim comma As Char 40 comma = &h2c 'Asc(",") 41 While 1 42 i3=0 43 While 1 44 If InputStr[i2]=comma Then 45 buf[i3]=0 46 Exit While 47 End If 48 49 buf[i3]=InputStr[i2] 50 51 If InputStr[i2]=0 Then Exit While 52 53 i2++ 54 i3++ 55 Wend 56 57 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], buf, i3) 58 59 i++ 60 If _System_InputDataPtr[i]=0 And InputStr[i2]=comma Then 37 Const comma = &h2c As StrChar 'Asc(",") 38 Dim broken = ActiveBasic.Strings.Detail.Split(New String(InputBuf, dwAccessBytes As Long), comma) 39 Dim i As Long 40 For i = 0 To ELM(broken.Count) 41 If _System_InputDataPtr[i] = 0 Then 61 42 PRINT_ToPrompt(Ex"入力データの個数が多すぎます\r\n") 62 43 Goto *InputReStart 63 ElseIf InputStr[i2]=0 Then64 If _System_InputDataPtr[i]<>0 Then65 PRINT_ToPrompt(Ex"入力データの個数が足りません\r\n")66 Goto *InputReStart67 Else68 Exit While69 End If70 44 End If 45 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], broken[i].ToString) 46 Next 71 47 72 i2++ 73 Wend 48 If _System_InputDataPtr[i]<>0 Then 49 PRINT_ToPrompt(Ex"入力データの個数が足りません\r\n") 50 Goto *InputReStart 51 End If 74 52 End Sub 75 53 … … 90 68 _System_free(pszOut) 91 69 #else 92 WriteConsole(_System_hConsoleOut, buf. Chars, buf.Length, dwAccessBytes, 0)70 WriteConsole(_System_hConsoleOut, buf.StrPtr, buf.Length, dwAccessBytes, 0) 93 71 #endif 94 72 End Sub
Note:
See TracChangeset
for help on using the changeset viewer.