1. To Robert Craig ... help !!!

Rob,
        Amid all your woes comes another one.

        BUT U CAN SOLVE I AM SURE >>  !!

Please ...... how do I get code to recognise gets() input. ?

include get.e
include file_ln.e
constant SCREEN = 1
constant KEYBRD = 0
constant TRUE=1
sequence line,name
object exit_code
atom w
puts(SCREEN, "Enter your Directory name here: ")

line = gets(KEYBRD) --------------------  CAN I GET THIS  BESIDE  "c:\\"  below
???

print(SCREEN, line)
puts(SCREEN, line[1..$-1])
puts(SCREEN, line)
clear_screen()
                  name=line
                   printf(1,"%s",{name})
                   w=wait_key()
function look_at(sequence path_name,sequence entry)
    printf(1,"%s\\%s: %d\n\t\t",{path_name,entry[D_NAME], entry[D_SIZE]})
    return 0
end function
exit_code = walk_dir("c:\\"  , routine_id("look_at"), TRUE)
w=wait_key()  

get the  "c:\\" to accept my input of gets()  ????
like ................      "c:\\"  &  my input ...

hope you can help.

sometime ????

cheers  les.r.

new topic     » topic index » view message » categorize

2. Re: To Robert Craig ... help !!!

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu