Ok, the previous code works perfectly, the compiler error showed in the last post dues to incorrect end of line(CRLF for Win and LF for UNIX)!
Thanks to wysota!!!