hedgewars/uMisc.pas
changeset 2797 98b990feec7d
parent 2796 7f86e7ad378b
child 2803 1f446fc5c8ec
equal deleted inserted replaced
2796:7f86e7ad378b 2797:98b990feec7d
   734 {$IFDEF DEBUGFILE}
   734 {$IFDEF DEBUGFILE}
   735 {$I-}
   735 {$I-}
   736 {$IFDEF IPHONEOS}
   736 {$IFDEF IPHONEOS}
   737 	f:= stderr;
   737 	f:= stderr;
   738 {$ELSE}
   738 {$ELSE}
   739 	for i:= 0 to 7 do
   739 	if ParamStr(1) <> '' then
   740 	begin
   740 		begin
   741 		assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
   741 		for i:= 0 to 7 do
   742 		rewrite(f);
   742 		begin
   743 		if IOResult = 0 then break;
   743 			assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
   744 	end;
   744 			rewrite(f);
   745 	if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr
   745 			if IOResult = 0 then break;
       
   746 		end;
       
   747 		if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr
       
   748 		end
       
   749 	else
       
   750 		f:= stderr;
   746 {$ENDIF}
   751 {$ENDIF}
   747 {$I+}
   752 {$I+}
   748 {$ENDIF}
   753 {$ENDIF}
   749 
   754 
   750 end;
   755 end;