Index: Include/basic/prompt.sbp
===================================================================
--- Include/basic/prompt.sbp	(revision 121)
+++ Include/basic/prompt.sbp	(revision 123)
@@ -38,11 +38,5 @@
 
 _PromptSys_bInitFinish=0
-CreateThread( _
-	0,
-	0,
-	AddressOf(PromptMain) As LPTHREAD_START_ROUTINE,
-	0 As VoidPtr,
-	0,
-	_PromptSys_dwThreadID)
+CreateThread(0, 0, AddressOf(PromptMain) As LPTHREAD_START_ROUTINE, 0, 0, _PromptSys_dwThreadID)
 Do
 	Sleep(20)
@@ -135,10 +129,5 @@
 			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
+				_System_FillChar(VarPtr(_PromptSys_Buffer[.y][.x]), i3, &h20) 'Asc(" ")
 				i2++
 				.x += i3
@@ -194,5 +183,5 @@
 			Dim tm As TEXTMETRIC
 			Dim hOldFont=SelectObject(_PromptSys_hMemDC, _PromptSys_hFont) As HFONT
-			GetTextExtentPoint32(_PromptSys_hMemDC, Ex" " As PCTSTR, 1, _PromptSys_FontSize)
+			GetTextExtentPoint32(_PromptSys_hMemDC, " " As PCTSTR, 1, _PromptSys_FontSize)
 			GetTextMetrics(_PromptSys_hMemDC, tm)
 			SelectObject(_PromptSys_hMemDC, hOldFont)
@@ -215,6 +204,6 @@
 					With CompForm
 						.dwStyle = CFS_POINT
-						.ptCurrentPos.x = _PromptSys_CurPos.x*_PromptSys_FontSize.cx
-						.ptCurrentPos.y = _PromptSys_CurPos.y*_PromptSys_FontSize.cy
+						.ptCurrentPos.x = _PromptSys_CurPos.x * _PromptSys_FontSize.cx
+						.ptCurrentPos.y = _PromptSys_CurPos.y * _PromptSys_FontSize.cy
 					End With
 					ImmSetCompositionWindow(hIMC, CompForm)
@@ -223,5 +212,5 @@
 				ImmReleaseContext(hWnd, hIMC)
 
-				CreateCaret(hWnd,NULL,9,6)
+				CreateCaret(hWnd, NULL, 9, 6)
 				SetCaretPos(_PromptSys_CurPos.x*_PromptSys_FontSize.cx, _
 					(_PromptSys_CurPos.y+1)*_PromptSys_FontSize.cy-7)
@@ -256,7 +245,8 @@
 					Dim pTemp = GlobalLock(hGlobal) As PCSTR
 #ifdef UNICODE 'A版ウィンドウプロシージャ用
-					Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, -1, 0, 0) + 1
+					Dim tempSizeA = lstrlenA(pTemp)
+					Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, tempSizeA, 0, 0) + 1
 					TempStr = ZeroString(tempSizeW)
-					MultiByteToWideChar(CP_ACP, 0, pTemp, -1, StrPtr(TempStr), tempSizeW)
+					MultiByteToWideChar(CP_ACP, 0, pTemp, tempSizeA, StrPtr(TempStr), tempSizeW)
 #else
 					TempStr = ZeroString(lstrlen(pTemp) + 1)
@@ -335,25 +325,27 @@
 	'Regist Prompt Class
 	Dim wcl As WNDCLASSEX
-	FillMemory(VarPtr(wcl),Len(wcl),0)
-	wcl.cbSize=Len(wcl)
-	wcl.hInstance=GetModuleHandle(0)
-	wcl.style=CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS
-	wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))
-	wcl.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_WINLOGO))
-	wcl.hCursor=LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW))
-	wcl.lpszClassName="PROMPT"
-	wcl.lpfnWndProc=AddressOf(PromptProc)
-	wcl.hbrBackground=GetStockObject(BLACK_BRUSH)
+	ZeroMemory(VarPtr(wcl), Len(wcl))
+	With wcl
+		.cbSize = Len(wcl)
+		.hInstance = GetModuleHandle(0)
+		.style = CS_HREDRAW or CS_VREDRAW' or CS_DBLCLKS
+		.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION))
+		.hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(IDI_WINLOGO))
+		.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW))
+		.lpszClassName = "PROMPT"
+		.lpfnWndProc = AddressOf(PromptProc)
+		.hbrBackground = GetStockObject(BLACK_BRUSH)
+	End With
 	Dim atom = RegisterClassEx(wcl)
 
 	'Create Prompt Window
 	_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)
+	ShowWindow(_PromptSys_hWnd, SW_SHOW)
 	UpdateWindow(_PromptSys_hWnd)
 
-	Dim msg As MSG, iResult As Long
+	Dim msg As MSG
 	Do
-		iResult=GetMessage(msg,0,0,0)
-		If iResult=0 or iResult=-1 Then Exit Do
+		Dim iResult = GetMessage(msg, 0, 0, 0)
+		If iResult = 0 or iResult = -1 Then Exit Do
 		TranslateMessage(msg)
 		DispatchMessage(msg)
@@ -392,9 +384,11 @@
 	If num=1 or num=3 Then
 		'Clear the text screen
-		For i=0 To 100
-			FillMemory(_PromptSys_Buffer[i],255,0)
+		For i = 0 To 100
+			_System_FillChar(_PromptSys_Buffer[i],255,0)
 		Next
-		_PromptSys_CurPos.x=0
-		_PromptSys_CurPos.y=0
+		With _PromptSys_CurPos
+			.x = 0
+			.y = 0
+		End With
 	End If
 
@@ -488,8 +482,8 @@
 	If y<0 Then y=0
 	If y>100 Then y=100
-
-	_PromptSys_CurPos.x=x
-	_PromptSys_CurPos.y=y
-
+	With _PromptSys_CurPos
+		.x = x
+		.y = y
+	End With
 	i=0
 	While _PromptSys_Buffer[y][i]
@@ -497,8 +491,8 @@
 	Wend
 
-	If i<x Then
-		FillMemory(_PromptSys_Buffer[y]+i,x-i,Asc(" "))
-		For i2=i To x-1
-			_PromptSys_BackColor[y][i2]=-1
+	If i < x Then
+		_System_FillChar(VarPtr(_PromptSys_Buffer[y][i]), x - i, &h20) 'Asc(" ")
+		For i2 = i To x - 1
+			_PromptSys_BackColor[y][i2] = -1
 		Next
 	End If
