Index: trunk/abdev/BasicCompiler32/Compile_Statement.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 402)
+++ trunk/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 408)
@@ -922,5 +922,6 @@
 std::vector<SelectSchedule> selectSchedules;
 
-void OpcodeSelect(const char *lpszParms){
+void OpcodeSelect(const char *lpszParms)
+{
 	extern HANDLE hHeap;
 	extern char *basbuf;
@@ -929,209 +930,210 @@
 	
 	Type type1;
-	if( !NumOpe(lpszParms,Type(), type1 ) ){
-		return;
-	}
+	bool result = NumOpe(lpszParms,Type(), type1 );
 
 	selectSchedules.push_back( SelectSchedule( type1.GetSize() ) );
 
-	if( selectSchedules.back().typeSize < sizeof(long) ){
-		selectSchedules.back().typeSize = sizeof(long);
-	}
-
-	for(i=cp,sw=0;;i++){
-		if(basbuf[i]=='\0'){
-			selectSchedules.pop_back();
-			SetError(22,"Select",cp);
-			return;
-		}
-		if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE){
-			for(i2=0;;i++){
-				if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE) i2++;
-				if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
-					i2--;
-					if(i2==0) break;
+	if( result )
+	{
+		if( selectSchedules.back().typeSize < sizeof(long) ){
+			selectSchedules.back().typeSize = sizeof(long);
+		}
+
+		for(i=cp,sw=0;;i++){
+			if(basbuf[i]=='\0'){
+				selectSchedules.pop_back();
+				SetError(22,"Select",cp);
+				return;
+			}
+			if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE){
+				for(i2=0;;i++){
+					if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE) i2++;
+					if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
+						i2--;
+						if(i2==0) break;
+					}
 				}
-			}
-			continue;
-		}
-		if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
-			if(sw==0){
-				//add esp,CaseTypeSize
-				compiler.codeGenerator.op_add_esp( selectSchedules.back().typeSize );
-			}
-			break;
-		}
-		if(basbuf[i]==1&&basbuf[i+1]==ESC_CASE){
-			NowCaseCp=i;
-
-			i++;
-			while(1){
-				for(i++,i2=0;;i++,i2++){
-					if(basbuf[i]=='\"'){
-						i3=GetStringInQuotation(temporary+i2,basbuf+i);
-						i+=i3-1;
-						i2+=i3-1;
-						continue;
+				continue;
+			}
+			if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
+				if(sw==0){
+					//add esp,CaseTypeSize
+					compiler.codeGenerator.op_add_esp( selectSchedules.back().typeSize );
+				}
+				break;
+			}
+			if(basbuf[i]==1&&basbuf[i+1]==ESC_CASE){
+				NowCaseCp=i;
+
+				i++;
+				while(1){
+					for(i++,i2=0;;i++,i2++){
+						if(basbuf[i]=='\"'){
+							i3=GetStringInQuotation(temporary+i2,basbuf+i);
+							i+=i3-1;
+							i2+=i3-1;
+							continue;
+						}
+						if(basbuf[i]=='('){
+							i3=GetStringInPare(temporary+i2,basbuf+i);
+							i+=i3-1;
+							i2+=i3-1;
+							continue;
+						}
+						if(basbuf[i]=='['){
+							i3=GetStringInBracket(temporary+i2,basbuf+i);
+							i+=i3-1;
+							i2+=i3-1;
+							continue;
+						}
+
+						if(IsCommandDelimitation(basbuf[i])){
+							temporary[i2]=0;
+							break;
+						}
+						if(basbuf[i]==','){
+							temporary[i2]=0;
+							break;
+						}
+
+						temporary[i2]=basbuf[i];
 					}
-					if(basbuf[i]=='('){
-						i3=GetStringInPare(temporary+i2,basbuf+i);
-						i+=i3-1;
-						i2+=i3-1;
-						continue;
-					}
-					if(basbuf[i]=='['){
-						i3=GetStringInBracket(temporary+i2,basbuf+i);
-						i+=i3-1;
-						i2+=i3-1;
-						continue;
-					}
-
-					if(IsCommandDelimitation(basbuf[i])){
-						temporary[i2]=0;
-						break;
-					}
-					if(basbuf[i]==','){
-						temporary[i2]=0;
-						break;
-					}
-
-					temporary[i2]=basbuf[i];
-				}
-
-				//エラー用
-				i2=cp;
-				cp=NowCaseCp;
-
-				Type type2;
-				if( !NumOpe(temporary,type1,type2) ){
-					return;
-				}
-
-				cp=i2;
-
-				if(type1.IsObject()){
-					std::vector<const UserProc *> subs;
-					type1.GetClass().GetDynamicMethods().Enum( CALC_EQUAL, subs );
-					if( subs.size() == 0 ){
+
+					//エラー用
+					i2=cp;
+					cp=NowCaseCp;
+
+					Type type2;
+					if( !NumOpe(temporary,type1,type2) ){
 						return;
 					}
 
-					Parameters params;
-					params.push_back( new Parameter( "", Type( type2 ) ) );
-
-					//オーバーロードを解決
-					const UserProc *pUserProc = OverloadSolution("==",subs, params, NULL);
-
-					delete params[0];
-
-					if(!pUserProc){
-						//エラー
-						return;
+					cp=i2;
+
+					if(type1.IsObject()){
+						std::vector<const UserProc *> subs;
+						type1.GetClass().GetDynamicMethods().Enum( CALC_EQUAL, subs );
+						if( subs.size() == 0 ){
+							return;
+						}
+
+						Parameters params;
+						params.push_back( new Parameter( "", Type( type2 ) ) );
+
+						//オーバーロードを解決
+						const UserProc *pUserProc = OverloadSolution("==",subs, params, NULL);
+
+						delete params[0];
+
+						if(!pUserProc){
+							//エラー
+							return;
+						}
+
+
+						//pop edx
+						compiler.codeGenerator.op_pop(REG_EDX);
+
+						//mov ecx,dword ptr[esp]
+						compiler.codeGenerator.op_mov_RM(sizeof(long),REG_ECX,REG_ESP,0,MOD_BASE);
+
+						//push edx
+						compiler.codeGenerator.op_push(REG_EDX);
+
+						//push ecx
+						compiler.codeGenerator.op_push(REG_ECX);
+
+						//call operator_proc	※ ==演算子
+						compiler.codeGenerator.op_call(pUserProc);
+
+						//test eax,eax
+						compiler.codeGenerator.op_test(REG_EAX,REG_EAX);
+
+						//jne ...
+						selectSchedules.back().casePertialSchedules.push_back(
+							compiler.codeGenerator.op_jne( 0, sizeof(long), true )
+						);
 					}
-
-
-					//pop edx
-					compiler.codeGenerator.op_pop(REG_EDX);
-
-					//mov ecx,dword ptr[esp]
-					compiler.codeGenerator.op_mov_RM(sizeof(long),REG_ECX,REG_ESP,0,MOD_BASE);
-
-					//push edx
-					compiler.codeGenerator.op_push(REG_EDX);
-
-					//push ecx
-					compiler.codeGenerator.op_push(REG_ECX);
-
-					//call operator_proc	※ ==演算子
-					compiler.codeGenerator.op_call(pUserProc);
-
-					//test eax,eax
-					compiler.codeGenerator.op_test(REG_EAX,REG_EAX);
-
-					//jne ...
-					selectSchedules.back().casePertialSchedules.push_back(
-						compiler.codeGenerator.op_jne( 0, sizeof(long), true )
-					);
+					else if(type1.IsDouble()){
+						ChangeTypeToDouble(type2.GetBasicType());
+
+						//fld qword ptr[esp]
+						compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
+
+						//add esp,CaseTypeSize
+						compiler.codeGenerator.op_add_esp(selectSchedules.back().typeSize);
+
+						//fld qword ptr[esp]
+						compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
+
+						//fcompp
+						compiler.codeGenerator.op_fcompp();
+
+						//fnstsw ax
+						compiler.codeGenerator.op_fnstsw_ax();
+
+						//test ah,40
+						compiler.codeGenerator.op_test_ah( (char)0x40 );
+
+						//jne ...
+						selectSchedules.back().casePertialSchedules.push_back(
+							compiler.codeGenerator.op_jne( 0, sizeof(long), true )
+						);
+					}
+					else if(type1.IsSingle()){
+						ChangeTypeToSingle(type2.GetBasicType());
+
+						//fld dword ptr[esp]
+						compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
+
+						//add esp,CaseTypeSize
+						compiler.codeGenerator.op_add_esp(selectSchedules.back().typeSize);
+
+						//fld dword ptr[esp]
+						compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
+
+						//fcompp
+						compiler.codeGenerator.op_fcompp();
+
+						//fnstsw ax
+						compiler.codeGenerator.op_fnstsw_ax();
+
+						//test ah,40
+						compiler.codeGenerator.op_test_ah( (char)0x40 );
+
+						//jne ...
+						selectSchedules.back().casePertialSchedules.push_back(
+							compiler.codeGenerator.op_jne( 0, sizeof(long), true )
+						);
+					}
+					else{
+						//その他整数型
+
+						//pop ebx
+						compiler.codeGenerator.op_pop(REG_EBX);
+
+						//mov eax,dword ptr[esp]
+						compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_ESP, 0, MOD_BASE );
+
+						//cmp eax,ebx
+						compiler.codeGenerator.op_cmp_RR( REG_EAX, REG_EBX );
+
+						//je ...
+						selectSchedules.back().casePertialSchedules.push_back(
+							compiler.codeGenerator.op_je( 0, sizeof(long), true )
+						);
+					}
+
+					if(basbuf[i]!=',') break;
 				}
-				else if(type1.IsDouble()){
-					ChangeTypeToDouble(type2.GetBasicType());
-
-					//fld qword ptr[esp]
-					compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
-
-					//add esp,CaseTypeSize
-					compiler.codeGenerator.op_add_esp(selectSchedules.back().typeSize);
-
-					//fld qword ptr[esp]
-					compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
-
-					//fcompp
-					compiler.codeGenerator.op_fcompp();
-
-					//fnstsw ax
-					compiler.codeGenerator.op_fnstsw_ax();
-
-					//test ah,40
-					compiler.codeGenerator.op_test_ah( (char)0x40 );
-
-					//jne ...
-					selectSchedules.back().casePertialSchedules.push_back(
-						compiler.codeGenerator.op_jne( 0, sizeof(long), true )
-					);
-				}
-				else if(type1.IsSingle()){
-					ChangeTypeToSingle(type2.GetBasicType());
-
-					//fld dword ptr[esp]
-					compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
-
-					//add esp,CaseTypeSize
-					compiler.codeGenerator.op_add_esp(selectSchedules.back().typeSize);
-
-					//fld dword ptr[esp]
-					compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
-
-					//fcompp
-					compiler.codeGenerator.op_fcompp();
-
-					//fnstsw ax
-					compiler.codeGenerator.op_fnstsw_ax();
-
-					//test ah,40
-					compiler.codeGenerator.op_test_ah( (char)0x40 );
-
-					//jne ...
-					selectSchedules.back().casePertialSchedules.push_back(
-						compiler.codeGenerator.op_jne( 0, sizeof(long), true )
-					);
-				}
-				else{
-					//その他整数型
-
-					//pop ebx
-					compiler.codeGenerator.op_pop(REG_EBX);
-
-					//mov eax,dword ptr[esp]
-					compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_ESP, 0, MOD_BASE );
-
-					//cmp eax,ebx
-					compiler.codeGenerator.op_cmp_RR( REG_EAX, REG_EBX );
-
-					//je ...
-					selectSchedules.back().casePertialSchedules.push_back(
-						compiler.codeGenerator.op_je( 0, sizeof(long), true )
-					);
-				}
-
-				if(basbuf[i]!=',') break;
-			}
-		}
-		if(basbuf[i]==1&&basbuf[i+1]==ESC_CASEELSE){
-			sw=1;
-
-			//jmp ...
-			selectSchedules.back().casePertialSchedules.push_back(
-				compiler.codeGenerator.op_jmp( 0, sizeof(long), true )
-			);
+			}
+			if(basbuf[i]==1&&basbuf[i+1]==ESC_CASEELSE){
+				sw=1;
+
+				//jmp ...
+				selectSchedules.back().casePertialSchedules.push_back(
+					compiler.codeGenerator.op_jmp( 0, sizeof(long), true )
+				);
+			}
 		}
 	}
