Re: Conflicts with words
- Posted by DerekParnell (admin) Sep 10, 2012
- 1109 views
sergelli said...
Hello
What is the simplest way to solve problems like this:
C:\1usre\sockets\connect.exw:25 <0135>:: Syntax error - expected to see an expression, not a procedure success=close(sock) ^
Thanks in advance
close(sock)
The reason you are getting that error message is that an expression is meant to follow an '=' symbol but the close() routine is not an expression because it is a procedure, which means that it does not return a value. As close() cannot return a value, you can't use it to assign a value to the success variable.
Are you trying to see if the call to close() worked or not? You could try this ...
close(sock) if seek(sock,-1) = 1 then -- file is closed end if
Oh ... now I get it... you are trying to use the sockets library close and not the i/o close. In that case, use the namespace 'sockets'.
success=sockets:close(sock)