Changeset 272 for Include/basic/prompt.sbp
- Timestamp:
- Jun 12, 2007, 7:24:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/basic/prompt.sbp
r269 r272 75 75 76 76 Sub _PromptSys_Initialize() 77 _PromptSys_hInitFinish = CreateEvent(0, FALSE, FALSE, 0)78 Dim _PromptSys_hThread = CreateThread(0, 0, AddressOf(PromptMain), 0, 0, _PromptSys_dwThreadID)79 If _PromptSys_hThread = 0 Then80 Debug81 ExitProcess(1)82 End If83 WaitForSingleObject(_PromptSys_hInitFinish, INFINITE)77 _PromptSys_hInitFinish = CreateEvent(0, FALSE, FALSE, 0) 78 Dim _PromptSys_hThread = CreateThread(0, 0, AddressOf(PromptMain), 0, 0, _PromptSys_dwThreadID) 79 If _PromptSys_hThread = 0 Then 80 Debug 81 ExitProcess(1) 82 End If 83 WaitForSingleObject(_PromptSys_hInitFinish, INFINITE) 84 84 End Sub 85 85 … … 191 191 charLen = 1 192 192 EndIf 193 _PromptSys_GetTextExtentPoint32(hdc, VarPtr(buf.Chars[i2]) As *StrChar, charLen, sz) 193 Dim p = buf.StrPtr 194 _PromptSys_GetTextExtentPoint32(hdc, VarPtr(p[i2]) As *StrChar, charLen, sz) 194 195 currentLineCharInfo[.x + 1].StartPos = currentLineCharInfo[.x].StartPos + sz.cx 195 196 /* … … 363 364 */ 364 365 Else 365 _PromptSys_InputStr[_PromptSys_InputLen] = wParam As Byte 366 Dim t = wParam As TCHAR 367 TempStr = New String(VarPtr(t), 1) 368 _PromptSys_InputStr[_PromptSys_InputLen] = TempStr[0] 366 369 _PromptSys_InputLen++ 367 368 TempStr.ReSize(1)369 TempStr[0] = wParam As Char370 370 End If 371 371 … … 403 403 Return 0 404 404 End If 405 Dim tempStr As String405 Dim tempStr = Nothing As String 406 406 Dim str As *StrChar 407 407 #ifdef __STRING_IS_NOT_UNICODE 408 408 Dim size = _PromptWnd_GetCompositionStringA(himc, str) 409 tempStr .Assign(str, size)409 tempStr = New String(str, size As Long) 410 410 #else 411 411 Dim osver = System.Environment.OSVersion … … 415 415 Dim strA As PCSTR 416 416 Dim sizeA = _PromptWnd_GetCompositionStringA(himc, strA) 417 tempStr .AssignFromMultiByte(strA, sizeA)417 tempStr = New String(strA, sizeA As Long) 418 418 Else 419 419 Dim size = _PromptWnd_GetCompositionStringW(himc, str) 420 tempStr .Assign(str, size \ SizeOf (WCHAR))420 tempStr = New String(str, (size \ SizeOf (WCHAR)) As Long) 421 421 End If 422 422 End With … … 425 425 _System_free(str) 426 426 427 memcpy(VarPtr(_PromptSys_InputStr[_PromptSys_InputLen]), tempStr.Chars, SizeOf (StrChar) * tempStr.Length)427 ActiveBasic.Strings.ChrCopy(VarPtr(_PromptSys_InputStr[_PromptSys_InputLen]), tempStr.StrPtr, tempStr.Length As SIZE_T) 428 428 _PromptSys_InputLen += tempStr.Length 429 429 … … 583 583 584 584 Sub INPUT_FromPrompt(showStr As String) 585 Dim i As Long, i2 As Long, i3 As Long586 Dim buf As String587 588 585 *InputReStart 589 586 … … 599 596 600 597 'Set value to variable 601 i = 0 602 i2 = 0 603 buf = ZeroString(lstrlen(_PromptSys_InputStr)) 604 While 1 605 i3 = 0 606 While 1 607 If _PromptSys_InputStr[i2] = &h2c Then 608 buf.Chars[i3] = 0 609 Exit While 610 End If 611 612 buf.Chars[i3] = _PromptSys_InputStr[i2] 613 614 If _PromptSys_InputStr[i2] = 0 Then Exit While 615 616 i2++ 617 i3++ 618 Wend 619 620 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], buf, i3) 621 622 i++ 623 If _System_InputDataPtr[i] = 0 and _PromptSys_InputStr[i2] = &h2c Then 'Asc(",") 598 Const comma = &h2c As StrChar 'Asc(",") 599 Dim broken = ActiveBasic.Strings.Detail.Split(New String(_PromptSys_InputStr), comma) 600 Dim i As Long 601 For i = 0 To ELM(broken.Count) 602 If _System_InputDataPtr[i] = 0 Then 624 603 ActiveBasic.Prompt.Detail.PRINT_ToPrompt(Ex"入力データの個数が多すぎます\r\n") 625 604 Goto *InputReStart 626 ElseIf _PromptSys_InputStr[i2] = 0 Then 627 If _System_InputDataPtr[i]<>0 Then 628 ActiveBasic.Prompt.Detail.PRINT_ToPrompt(Ex"入力データの個数が足りません\r\n") 629 Goto *InputReStart 630 Else 631 Exit While 632 End If 633 End If 634 635 i2++ 636 Wend 605 End If 606 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], broken[i].ToString) 607 Next 608 609 If _System_InputDataPtr[i]<>0 Then 610 ActiveBasic.Prompt.Detail.PRINT_ToPrompt(Ex"入力データの個数が足りません\r\n") 611 Goto *InputReStart 612 End If 637 613 End Sub 638 614
Note:
See TracChangeset
for help on using the changeset viewer.