2012-07-08 2 views
4

가 나는 옥타브 3.6.2에 다음 행에 대해 구문 오류를 얻을 경우 :옥타브 : 같은 라인 + 더

if(exist('OCTAVE_VERSION')~=0) more off; end 

동안 :

if(exist('OCTAVE_VERSION')~=0) 
more off; 
end 

이 좋아 보인다. 아직 :

if(exist('OCTAVE_VERSION')~=0) fflush(stdout); end 

잘 작동합니다.

more의 괄호 안의 인수가 아닌 버그 (?)입니까?

감사

답변

3

는 또한 옥타브 3.4.3에서 같은 결과를 얻었다 : 둘의 '명령'더 오프 '를 사용하거나

는 옥타브에 무해한 컴파일러의 버그가있는 것 같다 '한 줄의 if 문 안에 구문 오류가 발생합니다.

조건문 뒤에 개행을 추가하거나 eval (...) 안에 "more off"를 둘러싸면 올바르게 작동합니다.

%works correctly, turns off paging screen output 
if(1) 
    more off; 
end 

%works correctly, prints 3.4.3 
if(1) disp(OCTAVE_VERSION); end 

%works correctly, prints '1' 
if(1) disp([1]); more off; end 

%syntax error when parsing "off" in 'more off'. 
if(1) more off; endif 

%syntax error on parsing 'off' in 'more off;' 
if 1 more off; endif 

%works correctly, turns off paging screen output 
if (1) eval("more off"); endif 

던져 구문 오류가 있습니다 : "오류 : 스크립트 파일을 읽는 동안 구문 분석 오류".