On Mon, 2004-08-02 at 14:52, Prasanna Kothari wrote: > Hi, Hi
> [... code ...] I have tried your code and it works... > Notice that the code snippet is executing vi with a file and hence > editor opens up the file. After typing if I give a wrong vi command for > eg: "W" instead of "w"; $val gets a value greater than zero(256) and This does not happen to me :-| > hence the else part gets executed. The number of times I give a wrong vi > command , the return value gets incremented by 256. > This snippet is part of a larger program, which opens a editor and asks > the user to type in, after the user saves the file contents and exits > out of the editor, the program reads the contents of the file for > further processing. > > Is there a way to overcome this situation? Are you sure the problem is in that piece of code? Have you tried separating it from the rest of code and test it alone? Because that's what I've done and it works... $val has always been 0 :-| > Thanks in advance HTH, jac > Prasanna > > > > > -- José Alves de Castro <[EMAIL PROTECTED]> http://natura.di.uminho.pt/~jac
signature.asc
Description: This is a digitally signed message part