Sunday, 15 February 2015

comments - Stata delimit in command line -



comments - Stata delimit in command line -

i working on .do file created else. person used semicolon delimiter in entire file. trying go through file , see going on. selecting portion of code , hitting "execute selection (do)" button. however, delimiter seems messing this. there workarounds me?

suppose do-file looks this:

#delimit ; set obs 10 ; gen x = _n ; gen y = x^2 ; gen z = x ^3;

anytime highlight selection , press "execute selection (do)", stata creates temporary, self-contained do-file, default delimit @ cr , runs that:

"when do-file begins execution, delimiter automatically set carriage return, if called do-file set delimiter semicolon."

it not sequentially run commands console. therefore, if select first 2 commands in do-file above, temporary do-file includes phone call #delimit whereas if selected lastly 2 commands, temporary do-file not have phone call , throw syntax error 2 line commands.

one solution copy-paste selections fresh do-file had #delimit command @ beginning, , run that.

you write script rid do-file of semicolons. if line not end in semicolon, append next line end of current line, , check line again. depending on how complex syntax in do-file, more or less difficult.

comments stata

No comments:

Post a Comment