eval() function
- Posted by Alex Chamberlain <alex.chamberlain at tiscali.co.uk> Nov 01, 2005
- 607 views
After my unsuccessful attempt at using OOEU's eval() function, I thought I would write my own that will work with the normal rds download. But it won't work!
constant EVAL_FILE_NAME = "tmp_evalfile.ex" constant EVAL_ERROR = -1 global function eval(sequence data) integer tmp_fn, ret sequence plat tmp_fn = open(EVAL_FILE_NAME, "w") if tmp_fn = -1 then puts(1, "Could not opne temporary eval file ... Sorry!") return EVAL_ERROR end if puts(tmp_fn, data) if platform() = DOS32 then plat = "ex" elsif platform() = WIN32 then plat = "exw" elsif (platform() = LINUX) or (platform() = FREEBSD) then plat = "exu" end if puts(1, plat & " " & EVAL_FILE_NAME & " > eval.out") ret = system_exec(plat & " " & EVAL_FILE_NAME, 0) system("DELE " & EVAL_FILE_NAME, 0) return ret end function
Can somebody help me? Thanks, Alex P.S. Matt Lewis - Sorry I haven't emailed you any source that is not workin, but my PC is being wiped and I am using another so until I get it back and read off backups etc I can't get it to you.