Re: To Robert Craig ... help !!!
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 09, 2007
- 500 views
Try this. Note that \\ is needed inside a Euphoria string, to get a single backslas character, but the user must type \ not \\
include get.e include file.e constant TRUE=1 sequence line integer exit_code, w, line_count line_count = 1 function look_at(sequence path_name,sequence entry) printf(1,"%s\\%s: %d\n", {path_name, entry[D_NAME], entry[D_SIZE]}) line_count += 1 if remainder(line_count, 20) = 0 then w = wait_key() end if return 0 end function puts(1, "enter path (without C:\\):\n") line = gets(0) -- will be a sequence with \n on the end -- (unless the user types control-Z) -- user must type single \ not \\ line = line[1..$-1] -- drop the \n puts(1, "c:\\" & line & ":\n\n") exit_code = walk_dir("c:\\" & line, routine_id("look_at"), TRUE) puts(1, "Type Enter to quit\n") w=wait_key()
Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com