Index: Include/basic/prompt.sbp
===================================================================
--- Include/basic/prompt.sbp	(revision 119)
+++ Include/basic/prompt.sbp	(revision 121)
@@ -13,5 +13,5 @@
 
 'text
-Dim _PromptSys_LogFont As LOGFONT
+Dim _PromptSys_LogFont As LOGFONTA 'LOGFONT
 Dim _PromptSys_hFont As HFONT
 Dim _PromptSys_FontSize As SIZE
@@ -21,8 +21,8 @@
 Dim _PromptSys_CurPos As POINTAPI
 Dim _PromptSys_Buffer[100] As *Char
-Dim _PromptSys_TextColor[100] As DWordPtr
-Dim _PromptSys_BackColor[100] As DWordPtr
-Dim _PromptSys_NowTextColor As DWord
-Dim _PromptSys_NowBackColor As DWord
+Dim _PromptSys_TextColor[100] As *COLORREF
+Dim _PromptSys_BackColor[100] As *COLORREF
+Dim _PromptSys_NowTextColor As COLORREF
+Dim _PromptSys_NowBackColor As COLORREF
 Dim _PromptSys_SectionOfBufferAccess As CRITICAL_SECTION
 
@@ -38,5 +38,5 @@
 
 _PromptSys_bInitFinish=0
-CreateThread(
+CreateThread( _
 	0,
 	0,
@@ -51,25 +51,24 @@
 Sub DrawPromptBuffer(hDC As HDC, StartLine As Long, EndLine As Long)
 	Dim i As Long, i2 As Long, i3 As Long
-	Dim hOldFont As HFONT
 	Dim sz As SIZE
 	Dim temporary[2] As Char
 
-	hOldFont=SelectObject(hDC,_PromptSys_hFont)
+	Dim hOldFont = SelectObject(hDC, _PromptSys_hFont) As HFONT
 
 	'Scroll
 	Dim rc As RECT
-	GetClientRect(_PromptSys_hWnd,rc)
+	GetClientRect(_PromptSys_hWnd, rc)
 	While (_PromptSys_CurPos.y+1)*_PromptSys_FontSize.cy>rc.bottom and _PromptSys_CurPos.y>0
-		HeapFree(_System_hProcessHeap,0,_PromptSys_Buffer[0])
-		HeapFree(_System_hProcessHeap,0,_PromptSys_TextColor[0])
-		HeapFree(_System_hProcessHeap,0,_PromptSys_BackColor[0])
+		_System_free(_PromptSys_Buffer[0])
+		_System_free(_PromptSys_TextColor[0])
+		_System_free(_PromptSys_BackColor[0])
 		For i=0 To 100-1
-			_PromptSys_Buffer[i]=_PromptSys_Buffer[i+1]
-			_PromptSys_TextColor[i]=_PromptSys_TextColor[i+1]
-			_PromptSys_BackColor[i]=_PromptSys_BackColor[i+1]
+			_PromptSys_Buffer[i] = _PromptSys_Buffer[i+1]
+			_PromptSys_TextColor[i] = _PromptSys_TextColor[i+1]
+			_PromptSys_BackColor[i] = _PromptSys_BackColor[i+1]
 		Next
-		_PromptSys_Buffer[100]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255)
-		_PromptSys_TextColor[100]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255*SizeOf(LONG_PTR))
-		_PromptSys_BackColor[100]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255*SizeOf(LONG_PTR))
+		_PromptSys_Buffer[100] = _System_calloc(SizeOf (Char) * 255)
+		_PromptSys_TextColor[100] = _System_calloc(SizeOf(COLORREF) * 255)
+		_PromptSys_BackColor[100] = _System_calloc(SizeOf(COLORREF) * 255)
 
 		_PromptSys_CurPos.y--
@@ -82,5 +81,7 @@
 	While i*_PromptSys_FontSize.cy<rc.bottom and i<=100
 		If StartLine=-1 or (StartLine<=i and i<=EndLine) Then
-			GetTextExtentPoint32(hDC,_PromptSys_Buffer[i],lstrlen(_PromptSys_Buffer[i]),sz)
+			i3 = lstrlen(_PromptSys_Buffer[i])
+			GetTextExtentPoint32(hDC, _PromptSys_Buffer[i], i3, sz)
+
 			BitBlt(hDC,_
 				sz.cx, i*_PromptSys_FontSize.cy, _
@@ -88,14 +89,14 @@
 				_PromptSys_hMemDC,sz.cx,i*_PromptSys_FontSize.cy,SRCCOPY)
 
-			i3=lstrlen(_PromptSys_Buffer[i])
-			For i2=0 To i3-1
-				SetTextColor(hDC,_PromptSys_TextColor[i][i2])
-				If _PromptSys_BackColor[i][i2]=-1 Then
-					SetBkMode(hDC,TRANSPARENT)
+			For i2 = 0 To i3-1
+				SetTextColor(hDC, _PromptSys_TextColor[i][i2])
+				If _PromptSys_BackColor[i][i2] = -1 Then
+					SetBkMode(hDC, TRANSPARENT)
 				Else
-					SetBkMode(hDC,OPAQUE)
-					SetBkColor(hDC,_PromptSys_BackColor[i][i2])
+					SetBkMode(hDC, OPAQUE)
+					SetBkColor(hDC, _PromptSys_BackColor[i][i2])
 				End If
 
+				Dim tempLen As Long
 				temporary[0]=_PromptSys_Buffer[i][i2]
 #ifdef UNICODE
@@ -104,12 +105,15 @@
 				If IsDBCSLeadByte(temporary[0]) Then
 #endif
-					temporary[1]=_PromptSys_Buffer[i][i2+1]
-					temporary[2]=0
+					temporary[1] = _PromptSys_Buffer[i][i2+1]
+					temporary[2] = 0
 					i2++
+					tempLen = 2
 				Else
-					temporary[1]=0
+					temporary[1] = 0
+					tempLen = 1
 				End If
-				TextOut(hDC,i2*_PromptSys_FontSize.cx,i*_PromptSys_FontSize.cy,_
-					temporary,lstrlen(temporary))
+				With _PromptSys_FontSize
+					TextOut(hDC, i2 * .cx, i * .cy, temporary, tempLen)
+				End With
 			Next
 		End If
@@ -118,50 +122,48 @@
 	Wend
 
-	SelectObject(hDC,hOldFont)
+	SelectObject(hDC, hOldFont)
 End Sub
 
 Sub PRINT_ToPrompt(buf As String)
 	EnterCriticalSection(_PromptSys_SectionOfBufferAccess)
-
-		Dim hDC As HDC
+	With _PromptSys_CurPos
 		Dim StartLine As Long
-		Dim i2 As Long, i3 As Long
-
-		StartLine=_PromptSys_CurPos.y
-
+		StartLine = .y
 		'Addition
-		i2=0
+		Dim i2 = 0 As Long, i3 As Long
 		Do
-			If buf[i2]=9 Then	'tab
-				i3=8-(_PromptSys_CurPos.x mod 8)
-
-				FillMemory(_PromptSys_Buffer[_PromptSys_CurPos.y]+_PromptSys_CurPos.x,i3,Asc(" "))
-
+			If buf[i2] = 9 Then	'tab
+				i3 = 8 - (.x And 7) '(.x mod 8)
+				Dim j As Long
+				Dim p = VarPtr(_PromptSys_Buffer[.y][.x]) As *Char
+				' FillMemory(_PromptSys_Buffer[.y]+.x, i3, Asc(" "))
+				For j = 0 To ELM(i3)
+					p[j] = &h20 'Asc(" ")
+				Next
 				i2++
-				_PromptSys_CurPos.x += i3
+				.x += i3
 				Continue
 			End If
 
-			If buf[i2]=13 and buf[i2+1]=10 Then	'\r\n
+			If buf[i2] = 13 and buf[i2+1] = 10 Then	'\r\n
 				i2 += 2
-				_PromptSys_CurPos.y++
-				_PromptSys_CurPos.x=0
+				.y++
+				.x = 0
 				Continue
 			End If
 
-			If buf[i2]=0 Then Exit Do
-			_PromptSys_Buffer[_PromptSys_CurPos.y][_PromptSys_CurPos.x]=buf[i2]
-			_PromptSys_TextColor[_PromptSys_CurPos.y][_PromptSys_CurPos.x]=_PromptSys_NowTextColor
-			_PromptSys_BackColor[_PromptSys_CurPos.y][_PromptSys_CurPos.x]=_PromptSys_NowBackColor
+			If buf[i2] = 0 Then Exit Do
+			_PromptSys_Buffer[.y][.x] = buf[i2]
+			_PromptSys_TextColor[.y][.x] = _PromptSys_NowTextColor
+			_PromptSys_BackColor[.y][.x] = _PromptSys_NowBackColor
 
 			i2++
-			_PromptSys_CurPos.x++
+			.x++
 		Loop
-
 		'Draw the text buffer added
-		hDC=GetDC(_PromptSys_hWnd)
-		DrawPromptBuffer(hDC,StartLine,_PromptSys_CurPos.y)
-		ReleaseDC(_PromptSys_hWnd,hDC)
-
+		Dim hDC = GetDC(_PromptSys_hWnd)
+		DrawPromptBuffer(hDC, StartLine, .y)
+		ReleaseDC(_PromptSys_hWnd, hDC)
+	End With
 	LeaveCriticalSection(_PromptSys_SectionOfBufferAccess)
 End Sub
@@ -172,48 +174,52 @@
 	Dim ps As PAINTSTRUCT
 	Dim TempStr As String
-	Dim temporary[255] As Byte
 	Dim CompForm As COMPOSITIONFORM
-	Dim hGlobal As HGLOBAL
 
 	Select Case message
 		Case WM_CREATE
-			hDC=GetDC(hWnd)
-			_PromptSys_hBitmap=CreateCompatibleBitmap(hDC,_PromptSys_ScreenSize.cx,_PromptSys_ScreenSize.cy)
-			_PromptSys_hMemDC=CreateCompatibleDC(hDC)
-			SelectObject(_PromptSys_hMemDC,_PromptSys_hBitmap)
+			hDC = GetDC(hWnd)
+			With _PromptSys_ScreenSize
+				_PromptSys_hBitmap = CreateCompatibleBitmap(hDC, .cx, .cy)
+			End With
+			_PromptSys_hMemDC = CreateCompatibleDC(hDC)
+			SelectObject(_PromptSys_hMemDC, _PromptSys_hBitmap)
 
 			'Initialize for Win9x
-			Dim hOldBrush As HBRUSH
-			hOldBrush=SelectObject(_PromptSys_hMemDC,GetStockObject(BLACK_BRUSH))
-			PatBlt(_PromptSys_hMemDC,0,0,_PromptSys_ScreenSize.cx,_PromptSys_ScreenSize.cy,PATCOPY)
-			SelectObject(_PromptSys_hMemDC,hOldBrush)
-
-			Dim hOldFont As HFONT
+			Dim hOldBrush = SelectObject(_PromptSys_hMemDC, GetStockObject(BLACK_BRUSH)) As HBRUSH
+			With _PromptSys_ScreenSize
+				PatBlt(_PromptSys_hMemDC, 0, 0, .cx, .cy, PATCOPY)
+			End With
+			SelectObject(_PromptSys_hMemDC, hOldBrush)
+
 			Dim tm As TEXTMETRIC
-			hOldFont=SelectObject(_PromptSys_hMemDC,_PromptSys_hFont)
-			GetTextExtentPoint32(_PromptSys_hMemDC," ",1,_PromptSys_FontSize)
-			GetTextMetrics(_PromptSys_hMemDC,tm)
-			SelectObject(_PromptSys_hMemDC,hOldFont)
-			_PromptSys_FontSize.cy=tm.tmHeight
+			Dim hOldFont=SelectObject(_PromptSys_hMemDC, _PromptSys_hFont) As HFONT
+			GetTextExtentPoint32(_PromptSys_hMemDC, Ex" " As PCTSTR, 1, _PromptSys_FontSize)
+			GetTextMetrics(_PromptSys_hMemDC, tm)
+			SelectObject(_PromptSys_hMemDC, hOldFont)
+			_PromptSys_FontSize.cy = tm.tmHeight
 
 			ReleaseDC(hWnd,hDC)
 		Case WM_PAINT
-			hDC=BeginPaint(hWnd,ps)
-			BitBlt(hDC,0,0,_PromptSys_ScreenSize.cx,_PromptSys_ScreenSize.cy,_PromptSys_hMemDC,0,0,SRCCOPY)
-			DrawPromptBuffer(hDC,-1,0)
-			EndPaint(hWnd,ps)
-
-			_PromptSys_bInitFinish=1
+			hDC = BeginPaint(hWnd,ps)
+			With _PromptSys_ScreenSize
+				BitBlt(hDC, 0, 0, .cx, .cy, _PromptSys_hMemDC, 0, 0, SRCCOPY)
+			End With
+			DrawPromptBuffer(hDC, -1, 0)
+			EndPaint(hWnd, ps)
+
+			_PromptSys_bInitFinish = TRUE
 		Case WM_SETFOCUS
 			If _PromptSys_InputLen<>-1 Then
-				hIMC=ImmGetContext(hWnd)
+				hIMC = ImmGetContext(hWnd)
 				If hIMC Then
-					CompForm.dwStyle=CFS_POINT
-					CompForm.ptCurrentPos.x=_PromptSys_CurPos.x*_PromptSys_FontSize.cx
-					CompForm.ptCurrentPos.y=_PromptSys_CurPos.y*_PromptSys_FontSize.cy
-					ImmSetCompositionWindow(hIMC,CompForm)
-					ImmSetCompositionFont(hIMC,_PromptSys_LogFont)
+					With CompForm
+						.dwStyle = CFS_POINT
+						.ptCurrentPos.x = _PromptSys_CurPos.x*_PromptSys_FontSize.cx
+						.ptCurrentPos.y = _PromptSys_CurPos.y*_PromptSys_FontSize.cy
+					End With
+					ImmSetCompositionWindow(hIMC, CompForm)
+					ImmSetCompositionFontA(hIMC, _PromptSys_LogFont)
 				End If
-				ImmReleaseContext(hWnd,hIMC)
+				ImmReleaseContext(hWnd, hIMC)
 
 				CreateCaret(hWnd,NULL,9,6)
@@ -230,48 +236,47 @@
 			End If
 		Case WM_CHAR
-			If _PromptSys_InputLen<>-1 Then
-				If wParam=VK_BACK Then
+			If _PromptSys_InputLen <> -1 Then
+				If wParam = VK_BACK Then
 					If _PromptSys_InputLen Then
-						_PromptSys_InputLen=_PromptSys_InputLen-1
-						_PromptSys_InputStr[_PromptSys_InputLen]=0
-
-						_PromptSys_CurPos.x=_PromptSys_CurPos.x-1
-						_PromptSys_Buffer[_PromptSys_CurPos.y][_PromptSys_CurPos.x]=0
+						_PromptSys_InputLen--
+						_PromptSys_InputStr[_PromptSys_InputLen] = 0
+
+						_PromptSys_CurPos.x--
+						_PromptSys_Buffer[_PromptSys_CurPos.y][_PromptSys_CurPos.x] = 0
 					End If
-				ElseIf wParam=VK_RETURN Then
-					_PromptSys_InputStr[_PromptSys_InputLen]=0
-					_PromptSys_InputLen=-1
-					TempStr=Ex"\r\n"
-				ElseIf wParam=&H16 Then
+				ElseIf wParam = VK_RETURN Then
+					_PromptSys_InputStr[_PromptSys_InputLen] = 0
+					_PromptSys_InputLen = -1
+					TempStr = Ex"\r\n"
+				ElseIf wParam = &H16 Then
 					'Paste Command(Use Clippboard)
 					OpenClipboard(hWnd)
-					hGlobal=GetClipboardData(CF_TEXT)
-					If hGlobal=0 Then PromptProc=0:Exit Function
-					Dim pTemp=GlobalLock(hGlobal) As *Byte
-#ifdef UNICODE
+					Dim hGlobal = GetClipboardData(CF_TEXT) As HGLOBAL
+					If hGlobal = 0 Then Return 0
+					Dim pTemp = GlobalLock(hGlobal) As PCSTR
+#ifdef UNICODE 'A版ウィンドウプロシージャ用
 					Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, -1, 0, 0) + 1
-					TempStr=ZeroString(tempSizeW)
+					TempStr = ZeroString(tempSizeW)
 					MultiByteToWideChar(CP_ACP, 0, pTemp, -1, StrPtr(TempStr), tempSizeW)
 #else
-					TempStr=ZeroString(lstrlen(pTemp)+1)
-					lstrcpy(StrPtr(TempStr),pTemp)
+					TempStr = ZeroString(lstrlen(pTemp) + 1)
+					lstrcpy(StrPtr(TempStr), pTemp)
 #endif
-					lstrcpy((VarPtr(_PromptSys_InputStr[0])+_PromptSys_InputLen) As *Byte,pTemp)
-					_PromptSys_InputLen=_PromptSys_InputLen+lstrlen(pTemp)
+					memcpy(VarPtr(_PromptSys_InputStr[_PromptSys_InputLen]), TempStr.Chars, SizeOf (Char) * TempStr.Length)
+					_PromptSys_InputLen += TempStr.Length
 
 					GlobalUnlock(hGlobal)
 					CloseClipboard()
 				Else
-					_PromptSys_InputStr[_PromptSys_InputLen]=wParam As Byte
+					_PromptSys_InputStr[_PromptSys_InputLen] = wParam As Byte
 					_PromptSys_InputLen++
 
-					temporary[0]=wParam As Byte
-					temporary[1]=0
-					TempStr=temporary
+					TempStr.ReSize(1)
+					TempStr[0] = wParam As Char
 				End If
 
-				SendMessage(hWnd,WM_KILLFOCUS,0,0)
+				SendMessage(hWnd, WM_KILLFOCUS, 0, 0)
 				PRINT_ToPrompt(TempStr)
-				SendMessage(hWnd,WM_SETFOCUS,0,0)
+				SendMessage(hWnd, WM_SETFOCUS, 0, 0)
 			End If
 		Case WM_DESTROY
@@ -292,7 +297,7 @@
 	'Allocate
 	For i=0 To 100
-		_PromptSys_Buffer[i]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255)
-		_PromptSys_TextColor[i]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255*SizeOf(LONG_PTR))
-		_PromptSys_BackColor[i]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255*SizeOf(LONG_PTR))
+		_PromptSys_Buffer[i] = _System_calloc(SizeOf (Char) * 255)
+		_PromptSys_TextColor[i] = _System_calloc(SizeOf(COLORREF) * 255)
+		_PromptSys_BackColor[i] = _System_calloc(SizeOf(COLORREF) * 255)
 	Next
 
@@ -306,20 +311,22 @@
 
 	'LogFont initialize
-	_PromptSys_LogFont.lfHeight=-16
-	_PromptSys_LogFont.lfWidth=0
-	_PromptSys_LogFont.lfEscapement=0
-	_PromptSys_LogFont.lfOrientation=0
-	_PromptSys_LogFont.lfWeight=0
-	_PromptSys_LogFont.lfItalic=0
-	_PromptSys_LogFont.lfUnderline=0
-	_PromptSys_LogFont.lfStrikeOut=0
-	_PromptSys_LogFont.lfCharSet=SHIFTJIS_CHARSET
-	_PromptSys_LogFont.lfOutPrecision=OUT_DEFAULT_PRECIS
-	_PromptSys_LogFont.lfClipPrecision=CLIP_DEFAULT_PRECIS
-	_PromptSys_LogFont.lfQuality=DEFAULT_QUALITY
-	_PromptSys_LogFont.lfPitchAndFamily=FIXED_PITCH
-	lstrcpy(_PromptSys_LogFont.lfFaceName,"ＭＳ 明朝")
-
-	_PromptSys_hFont=CreateFontIndirect(_PromptSys_LogFont)
+	With _PromptSys_LogFont
+		.lfHeight = -16
+		.lfWidth = 0
+		.lfEscapement = 0
+		.lfOrientation = 0
+		.lfWeight = 0
+		.lfItalic = 0
+		.lfUnderline = 0
+		.lfStrikeOut = 0
+		.lfCharSet = SHIFTJIS_CHARSET
+		.lfOutPrecision = OUT_DEFAULT_PRECIS
+		.lfClipPrecision = CLIP_DEFAULT_PRECIS
+		.lfQuality = DEFAULT_QUALITY
+		.lfPitchAndFamily = FIXED_PITCH
+		lstrcpy(.lfFaceName, "ＭＳ 明朝")
+	End With
+
+	_PromptSys_hFont = CreateFontIndirect(ByVal VarPtr(_PromptSys_LogFont))
 
 	'Critical Section
@@ -338,8 +345,8 @@
 	wcl.lpfnWndProc=AddressOf(PromptProc)
 	wcl.hbrBackground=GetStockObject(BLACK_BRUSH)
-	RegisterClassEx(wcl)
+	Dim atom = RegisterClassEx(wcl)
 
 	'Create Prompt Window
-	_PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,"PROMPT","BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0)
+	_PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,atom As ULONG_PTR As PCSTR,"BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0)
 	ShowWindow(_PromptSys_hWnd,SW_SHOW)
 	UpdateWindow(_PromptSys_hWnd)
@@ -353,13 +360,14 @@
 	Loop
 
+	'強制的に終了する
+	ExitProcess(0)
+
 	EnterCriticalSection(_PromptSys_SectionOfBufferAccess)
-		For i=0 to 100
-			HeapFree(_System_hProcessHeap,0,_PromptSys_Buffer[i])
-			HeapFree(_System_hProcessHeap,0,_PromptSys_TextColor[i])
-			HeapFree(_System_hProcessHeap,0,_PromptSys_BackColor[i])
-		Next
-
-		'強制的に終了する
-		ExitProcess(0)
+	
+	For i=0 to 100
+		_System_free(_PromptSys_Buffer[i])
+		_System_free(_PromptSys_TextColor[i])
+		_System_free(_PromptSys_BackColor[i])
+	Next
 
 	LeaveCriticalSection(_PromptSys_SectionOfBufferAccess)
@@ -432,18 +440,18 @@
 
 	'Set value to variable
-	i=0
-	i2=0
-	buf=ZeroString(lstrlen(_PromptSys_InputStr))
+	i = 0
+	i2 = 0
+	buf = ZeroString(lstrlen(_PromptSys_InputStr))
 	While 1
-		i3=0
+		i3 = 0
 		While 1
-			If _PromptSys_InputStr[i2]=Asc(",") Then
-				buf.Chars[i3]=0
+			If _PromptSys_InputStr[i2] = &h2c Then
+				buf.Chars[i3] = 0
 				Exit While
 			End If
 
-			buf.Chars[i3]=_PromptSys_InputStr[i2]
-
-			If _PromptSys_InputStr[i2]=0 Then Exit While
+			buf.Chars[i3] = _PromptSys_InputStr[i2]
+
+			If _PromptSys_InputStr[i2] = 0 Then Exit While
 
 			i2++
@@ -451,36 +459,8 @@
 		Wend
 
-		Select Case _System_InputDataType[i]
-			Case _System_Type_Double
-				SetDouble(_System_InputDataPtr[i],Val(buf))
-			Case _System_Type_Single
-				SetSingle(_System_InputDataPtr[i],Val(buf))
-			Case _System_Type_Int64,_System_Type_QWord
-				SetQWord(_System_InputDataPtr[i],Val(buf))
-			Case _System_Type_Long,_System_Type_DWord
-				SetDWord(_System_InputDataPtr[i],Val(buf))
-			Case _System_Type_Integer,_System_Type_Word
-				SetWord(_System_InputDataPtr[i],Val(buf))
-			Case _System_Type_SByte,_System_Type_Byte
-				SetByte(_System_InputDataPtr[i],Val(buf))
-			Case _System_Type_Char
-#ifdef UNICODE
-				SetWord(_System_InputDataPtr[i], buf[0])
-#else
-				SetByte(_System_InputDataPtr[i], buf[0])
-#endif
-			Case _System_Type_String
-			*INPUT_FromPrompt_Type_String
-				Dim pTempStr As *String
-				pTempStr=_System_InputDataPtr[i] As *String
-				pTempStr->ReSize(i3)
-				memcpy(pTempStr->Chars, buf.Chars, pTempStr->Length)
-				pTempStr->Chars[pTempStr->Length] = 0
-			Case 13
-				Goto *INPUT_FromPrompt_Type_String
-		End Select
+		_System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], buf, i3)
 
 		i++
-		If _System_InputDataPtr[i]=0 and _PromptSys_InputStr[i2]=Asc(",") Then
+		If _System_InputDataPtr[i]=0 and _PromptSys_InputStr[i2]=&h2c Then 'Asc(",")
 			PRINT_ToPrompt(Ex"入力データの個数が多すぎます\r\n")
 			Goto *InputReStart
@@ -494,5 +474,5 @@
 		End If
 
-		i2=i2+1
+		i2++
 	Wend
 End Sub
@@ -534,12 +514,10 @@
 	'Circle (x, y), radius [, color] [, start] [, end] [, aspect] [, f] [, color2]
 
-	Dim hDC As HDC
-	Dim hPen As HPEN, hOldPen As VoidPtr
-	Dim hBrush As HBRUSH, hOldBrush As VoidPtr
+	Dim hBrush As HBRUSH
 	Dim radi2 As Long
 	Dim sw As Long
 	Dim i1 As Long, i2 As Long, i3 As Long, i4 As Long
 
-	hPen=CreatePen(PS_SOLID,1,GetBasicColor(ColorCode))
+	Dim hPen = CreatePen(PS_SOLID,1,GetBasicColor(ColorCode))
 	If bFill Then
 		hBrush=CreateSolidBrush(GetBasicColor(BrushColor))
@@ -548,9 +526,9 @@
 	End If
 
-	hDC=GetDC(_PromptSys_hWnd)
+	Dim hDC=GetDC(_PromptSys_hWnd)
 	SelectObject(hDC,hPen)
 	SelectObject(hDC,hBrush)
-	hOldPen=SelectObject(_PromptSys_hMemDC,hPen)
-	hOldBrush=SelectObject(_PromptSys_hMemDC,hBrush)
+	Dim hOldPen=SelectObject(_PromptSys_hMemDC,hPen)
+	Dim hOldBrush=SelectObject(_PromptSys_hMemDC,hBrush)
 
 	If Aspect<1 Then
@@ -664,10 +642,7 @@
 	End If
 
-	Dim hDC As HDC
-	Dim hPen As HPEN, hOldPen As VoidPtr
-	Dim hBrush As HBRUSH, hOldBrush As VoidPtr
-
-	hDC=GetDC(_PromptSys_hWnd)
-	hPen=CreatePen(PS_SOLID,1,GetBasicColor(ColorCode))
+	Dim hDC = GetDC(_PromptSys_hWnd)
+	Dim hPen = CreatePen(PS_SOLID, 1, GetBasicColor(ColorCode))
+	Dim hBrush As HBRUSH
 	If fType=2 Then
 		hBrush=CreateSolidBrush(GetBasicColor(BrushColor))
@@ -678,6 +653,6 @@
 	SelectObject(hDC,hPen)
 	SelectObject(hDC,hBrush)
-	hOldPen=SelectObject(_PromptSys_hMemDC,hPen)
-	hOldBrush=SelectObject(_PromptSys_hMemDC,hBrush)
+	Dim hOldPen = SelectObject(_PromptSys_hMemDC,hPen)
+	Dim hOldBrush = SelectObject(_PromptSys_hMemDC,hBrush)
 
 	Select Case fType
@@ -710,7 +685,5 @@
 	'PSet (x,y),ColorCode
 
-	Dim hDC As HDC
-
-	hDC=GetDC(_PromptSys_hWnd)
+	Dim hDC=GetDC(_PromptSys_hWnd)
 	SetPixel(hDC,x,y,GetBasicColor(ColorCode))
 	SetPixel(_PromptSys_hMemDC,x,y,GetBasicColor(ColorCode))
