gets
- Posted by Philip Mullen <PETER at pmullen.fsnet.co.uk> Feb 16, 2002
- 471 views
This is a multi-part message in MIME format. ------=_NextPart_000_0028_01C1B6D4.70DAE440 boundary="----=_NextPart_001_0029_01C1B6D4.70DAE440" ------=_NextPart_001_0029_01C1B6D4.70DAE440 charset="iso-8859-1" Please can some one help with this, I have been trying to expirement with command lines and the gets paremeter but tis won't work, the programe just skips past, can someone get it to read it properly? ------=_NextPart_001_0029_01C1B6D4.70DAE440 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 5.50.4134.600" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#fffff0> <DIV><BR> </DIV> <DIV><FONT face=Arial size=2>Please can some one help with this, I have been trying to expirement with command lines and the gets paremeter but tis won't work, the programe just skips past, can someone get it to read it ------=_NextPart_001_0029_01C1B6D4.70DAE440-- ------=_NextPart_000_0028_01C1B6D4.70DAE440 Content-Type: application/octet-stream; name="Abort.ewl" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Abort.ewl" >va=0A= ------=_NextPart_000_0028_01C1B6D4.70DAE440 Content-Type: application/octet-stream; name="Ewl.ex" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Ewl.ex" include get.e=0A= include machine.e=0A= include sort.e=0A= include wildcard.e=0A= include input.e=0A= =0A= with trace=0A= =0A= sequence command=0A= puts(1,=0A= "Do you wish to trace ? (Y) / (N):\n ")=0A= command =3D upper(user_input())=0A= if 'Y' =3D command[1] then=0A= trace(1)=0A= end if=0A= =0A= if 'Y' =3D command[1] then=0A= trace(1)=0A= =0A= elsif 'N' =3D command[1] then=0A= trace(0)=0A= end if=0A= =0A= =0A= object temp=0A= temp =3D command_line()=0A= =0A= if length(temp) <=3D 2 then=0A= puts(1,"No program file selcted, Aborting")=0A= abort(42)=0A= end if=0A= =0A= sequence runfile,PS=0A= atom file=0A= =0A= PS =3D {}=0A= =0A= runfile=3Dtemp[3]=0A= file=3D open(runfile,"r")=0A= =0A= if file =3D -1 then=0A= printf(1,"%s does not exist, or you have got the wrong path",{runfile})=0A= abort(42)=0A= end if=0A= =0A= temp =3D gets(file)=0A= =0A= while not atom(temp) do=0A= =0A= PS =3D append(PS, temp)=0A= temp =3D gets(PS)=0A= =0A= end while=0A= =0A= =0A= while 1 do=0A= =0A= if compare(PS, 'a') =3D 0 then=0A= abort(42)=0A= =0A= elsif compare(PS,'h') =3D 0 then=0A= puts(1,"Hello")=0A= end if=0A= =0A= end while=0A= =0A= =0A= ------=_NextPart_000_0028_01C1B6D4.70DAE440 Content-Type: application/octet-stream; name="input.e" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="input.e" without warning=0A= =0A= constant KEYBOARD =3D 0,=0A= SCREEN =3D 1,=0A= ERROR =3D 2=0A= =0A= constant TRUE =3D 1=0A= constant WHITE_SPACE =3D " \t\n"=0A= constant FORM_FEED =3D 12=0A= =0A= global function user_input()=0A= -- get user input from keyboard=0A= object line=0A= =0A= while TRUE do=0A= line =3D gets(KEYBOARD)=0A= if sequence(line) then=0A= -- delete any leading whitespace=0A= while find(line[1], WHITE_SPACE) do=0A= line =3D line[2..length(line)]=0A= if length(line) =3D 0 then=0A= exit=0A= end if=0A= end while=0A= if length(line) > 0 then=0A= exit=0A= end if=0A= end if=0A= puts(SCREEN, "\n? ")=0A= end while=0A= -- delete trailing whitespace=0A= while find(line[length(line)], WHITE_SPACE) do=0A= line =3D line[1..length(line)-1]=0A= end while=0A= return line=0A= end function=0A= ------=_NextPart_000_0028_01C1B6D4.70DAE440--