Changeset 119 for Include/basic
- Timestamp:
- Feb 23, 2007, 11:00:24 PM (18 years ago)
- Location:
- Include/basic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/basic/command.sbp
r110 r119 6 6 7 7 8 Const _System_Type_ Char= 18 Const _System_Type_SByte = 1 9 9 Const _System_Type_Byte = 2 10 10 Const _System_Type_Integer = 3 … … 16 16 Const _System_Type_Single = 9 17 17 Const _System_Type_Double = 10 18 Const _System_Type_String = 11 18 Const _System_Type_Char = 11 19 Const _System_Type_String = 13 20 Const _System_Type_VoidPtr = 14 19 21 Const _System_MAX_PARMSNUM = 32-1 20 22 -
Include/basic/function.sbp
r110 r119 514 514 End If 515 515 End Sub 516 Function _ecvt(value As Double, count As Long, ByRef dec As Long, ByRef sign As Long) As BytePtr517 Dim temp As BytePtr516 Function _ecvt(value As Double, count As Long, ByRef dec As Long, ByRef sign As Long) As *Char 517 Dim temp As *Char 518 518 Dim i As Long, i2 As Long 519 519 … … 540 540 dec=1 541 541 While value<0.999999999999999 'value<1 542 value =value*10543 dec =dec-1542 value *= 10 543 dec-- 544 544 Wend 545 545 While 9.99999999999999<=value '10<=value 546 value =value/10547 dec =dec+1546 value /= 10 547 dec++ 548 548 Wend 549 549 … … 555 555 _System_ecvt_buffer[i]=0 556 556 557 i =i-1557 i-- 558 558 If value>=5 Then 559 559 '切り上げ処理 … … 562 562 563 563 For i=0 To count-1 564 _System_ecvt_buffer[i] =_System_ecvt_buffer[i]+&H30564 _System_ecvt_buffer[i] += &H30 565 565 Next 566 566 _System_ecvt_buffer[i]=0 … … 713 713 End Function 714 714 715 Function Val(buf As BytePtr) As Double715 Function Val(buf As *Char) As Double 716 716 Dim i As Long, i2 As Long, i3 As Long, i4 As Long 717 717 Dim temporary As String 718 Dim TempPtr As BytePtr718 Dim TempPtr As *Char 719 719 Dim dbl As Double 720 720 Dim i64data As Int64 … … 1024 1024 End Function 1025 1025 1026 Function _System_IsSurrogatePair(wcHigh As WCHAR, wcLow As WCHAR) As Boolean 1027 If &hD800 <= wcHigh And wcHigh < &hDC00 Then 1028 If &hDC00 <= wcLow And wcLow < &hE000 Then 1029 Return True 1030 End If 1031 End If 1032 Return False 1033 End Function 1026 1034 1027 1035 #endif '_INC_FUNCTION -
Include/basic/prompt.sbp
r110 r119 99 99 100 100 temporary[0]=_PromptSys_Buffer[i][i2] 101 #ifdef UNICODE 102 If _System_IsSurrogatePair(_PromptSys_Buffer[i][i2], _PromptSys_Buffer[i][i2+1]) Then 103 #else 101 104 If IsDBCSLeadByte(temporary[0]) Then 105 #endif 102 106 temporary[1]=_PromptSys_Buffer[i][i2+1] 103 107 temporary[2]=0 108 i2++ 104 109 Else 105 110 temporary[1]=0 … … 107 112 TextOut(hDC,i2*_PromptSys_FontSize.cx,i*_PromptSys_FontSize.cy,_ 108 113 temporary,lstrlen(temporary)) 109 110 If IsDBCSLeadByte(temporary[0]) Then i2++111 114 Next 112 115 End If … … 172 175 Dim CompForm As COMPOSITIONFORM 173 176 Dim hGlobal As HGLOBAL 174 Dim pTemp As BytePtr175 177 176 178 Select Case message … … 246 248 hGlobal=GetClipboardData(CF_TEXT) 247 249 If hGlobal=0 Then PromptProc=0:Exit Function 248 pTemp=GlobalLock(hGlobal) As *Byte 249 250 Dim pTemp=GlobalLock(hGlobal) As *Byte 251 #ifdef UNICODE 252 Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, -1, 0, 0) + 1 253 TempStr=ZeroString(tempSizeW) 254 MultiByteToWideChar(CP_ACP, 0, pTemp, -1, StrPtr(TempStr), tempSizeW) 255 #else 250 256 TempStr=ZeroString(lstrlen(pTemp)+1) 251 257 lstrcpy(StrPtr(TempStr),pTemp) 252 258 #endif 253 259 lstrcpy((VarPtr(_PromptSys_InputStr[0])+_PromptSys_InputLen) As *Byte,pTemp) 254 260 _PromptSys_InputLen=_PromptSys_InputLen+lstrlen(pTemp) … … 337 343 _PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,"PROMPT","BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0) 338 344 ShowWindow(_PromptSys_hWnd,SW_SHOW) 345 UpdateWindow(_PromptSys_hWnd) 339 346 340 347 Dim msg As MSG, iResult As Long … … 455 462 Case _System_Type_Integer,_System_Type_Word 456 463 SetWord(_System_InputDataPtr[i],Val(buf)) 457 Case _System_Type_ Char,_System_Type_Byte464 Case _System_Type_SByte,_System_Type_Byte 458 465 SetByte(_System_InputDataPtr[i],Val(buf)) 459 466 Case _System_Type_Char 467 #ifdef UNICODE 468 SetWord(_System_InputDataPtr[i], buf[0]) 469 #else 470 SetByte(_System_InputDataPtr[i], buf[0]) 471 #endif 460 472 Case _System_Type_String 473 *INPUT_FromPrompt_Type_String 461 474 Dim pTempStr As *String 462 475 pTempStr=_System_InputDataPtr[i] As *String … … 464 477 memcpy(pTempStr->Chars, buf.Chars, pTempStr->Length) 465 478 pTempStr->Chars[pTempStr->Length] = 0 479 Case 13 480 Goto *INPUT_FromPrompt_Type_String 466 481 End Select 467 482
Note:
See TracChangeset
for help on using the changeset viewer.