Re: Conflicts with words

new topic     » goto parent     » topic index » view thread      » older message » newer message
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) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu