Re: Euphoria Interpreter?
- Posted by Bryan So <sohim at yahoo.com> Jul 13, 2006
- 561 views
Thanks all for digging up the reference and for thinking about this problem. I'll look into it further! Thanks again. Bryan jacques deschĂȘnes wrote: > > > Hi Bryan, > > There is no command shell distributed with euphoria and as far as I know no > one written one. > > here a 5 cents fast done command interpreter.(At that price there is obviously > many limitations ;) > }}} <eucode> > -- name: eush5c.exw > -- 5 cents euphoria command shell > -- usage: exwc.exe eush5c.exw. > > sequence InputLine, buffer > constant TempFile="euShTemp.exw" > buffer = {"-- 'euphoria 5 cents command shell' generated file\n","without > warning\n"} > atom hFile > object void > > while 1 do > puts(1,"\neush>") > InputLine = gets(0) > if InputLine[1] = '?' or (match("print(1,",InputLine)=1) or > (match("printf(1,",InputLine)) > or > (match("puts(1,",InputLine)=1) then > puts(1,'\n') > hFile = open(TempFile,"w") > for i = 1 to length(buffer) do > puts(hFile,buffer[i]) > end for > puts(hFile,InputLine) > close(hFile) > void = system_exec("exwc.exe "&TempFile,0) > elsif equal(InputLine, "!quit\n") then -- quit shell > abort(0) > elsif equal(InputLine,"!flush\n") then -- flush command buffer > buffer = buffer[1..2] > else > buffer = append(buffer,InputLine) > end if > end while > > </eucode> {{{ > > regards, > Jacques DeschĂȘnes