Changeset 432 for trunk/Include/basic
- Timestamp:
- Feb 27, 2008, 1:04:59 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/basic/dos_console.sbp
r391 r432 9 9 Dim _System_hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE) 10 10 Dim _System_hConsoleIn = GetStdHandle(STD_INPUT_HANDLE) 11 System.Console.SetIn( 12 New System.IO.StreamReader( 13 New System.IO.FileStream(_System_hConsoleIn, System.IO.FileAccess.Read, False))) 11 14 12 15 '---------- command.sbp内で定義済み ---------- … … 15 18 '--------------------------------------------- 16 19 Sub INPUT_FromPrompt(ShowStr As String) 17 Dim InputBuf[1023] As TCHAR 18 Dim dwAccessBytes As DWord 19 20 *InputReStart 21 20 *InputReStart '多重Continueがあるので、これはループ構文に直せない。 22 21 PRINT_ToPrompt(ShowStr) 23 22 24 23 '入力 25 ReadConsole(_System_hConsoleIn, InputBuf, Len(InputBuf), dwAccessBytes, 0) 26 If InputBuf[dwAccessBytes-2] = &h0d And InputBuf[dwAccessBytes-1] = &h0a Then 27 InputBuf[dwAccessBytes-2] = 0 28 dwAccessBytes -= 2 24 Dim input = System.Console.ReadLine() 25 If ActiveBasic.IsNothing(input) Then 26 Exit Sub 29 27 End If 30 28 31 If dwAccessBytes= 0 Then Goto *InputReStart29 If input.Length = 0 Then Goto *InputReStart 32 30 33 31 'データを変数に格納 34 32 Const comma = &h2c As StrChar 'Asc(",") 35 Dim broken = ActiveBasic.Strings.Detail.Split( New String(InputBuf, dwAccessBytes As Long), comma)33 Dim broken = ActiveBasic.Strings.Detail.Split(input, comma) 36 34 Dim i As Long 37 35 For i = 0 To ELM(broken.Count) 38 36 If _System_InputDataPtr[i] = 0 Then 39 37 PRINT_ToPrompt(Ex"入力データの個数が多すぎます\r\n") 40 Goto *InputReStart38 Goto *InputReStart 41 39 End If 42 40 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], broken[i]) … … 45 43 If _System_InputDataPtr[i]<>0 Then 46 44 PRINT_ToPrompt(Ex"入力データの個数が足りません\r\n") 47 Goto *InputReStart45 Goto *InputReStart 48 46 End If 49 47 End Sub … … 54 52 55 53 Sub PRINT_ToPrompt(buf As String) 54 If String.IsNullOrEmpty(buf) Then 55 Exit Sub 56 End If 57 56 58 Dim dwAccessBytes As DWord 57 59 #ifdef __STRING_UNICODE_WINDOWS_ANSI
Note:
See TracChangeset
for help on using the changeset viewer.