| View previous topic :: View next topic |
| Author |
Message |
DoT_PiTcH Contributor

Joined: 07 Aug 2002 Posts: 85
|
Posted: Wed Dec 11, 2002 10:41 pm Post subject: hELP PLEASE |
|
|
below is a client/server prog im working on....
this is the server i would like some help with the removing an item from a list....
| Code: |
EXTERNAL VDSINET.DLL, Public Freeware Key|90257236
Net Socket, Auto
Net Socket, VDSevents
Net Socket, port, 12346
Net Socket, Addr, 127.0.0.1
Net Socket, Client
option fieldsep, " "
Title Client
DIALOG CREATE,client,-1,0,510,376
DIALOG ADD,EDIT,Typehere,348,2,432,24,/nick
DIALOG ADD,BUTTON,Send,348,438,68,24,Send,,default
DIALOG ADD,LIST,PeopleConnected,4,382,124,340
DIALOG ADD,LIST,MsgBox,4,2,378,340
DIALOG SHOW
List create, Peopleconnected, sorted
:evloop
%e = @event()
if %e
goto %e
else
%%Nete = @Net(Socket,Event)
if %%Nete
goto %%nete
end
goto evloop
:Connect
goto evloop
:Closec
info Server Quit!
list clear, peopleconnected
goto evloop
:error
goto evloop
:network
%%msg = @Net(Socket,Data)
parse "%%CMD;%%VAR", %%msg
if @equal(%%CMD, /nick)
goto LoadNicks
else
if @equal(%%CMD, /del)
goto userDisconnect
else
list add, MSGbox, @dlgtext(msgbox)%%msg@cr()
end
goto evloop
:SendBUTTON
Net Socket, sendserver, @dlgtext(typehere)
DIALOG CLEAR, typehere
goto evloop
:LoadNicks
list add, peopleconnected, %%var
%%var = %%Defaultname
goto evloop
REM // HERE IS WHERE THE PROBLEM IS
:UserDisconnect
list seek, peopleconnected, %%var
list delete, peopleconnected, %%var
goto evloop
:Close
Net Socket, Sendserver, /quit %%Defaultname
exit
|
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Dec 11, 2002 11:03 pm Post subject: |
|
|
Is %%var always a number that's within the list range?
Also don't use a second paramater with LIST DELETE.
Try this:
| Code: |
:UserDisconnect
if @not(@numeric(%%var))
WARN Var= %%var and is not numeric!@tab()
goto EVLOOP
end
if @greater(@count(peopleconnected), %%var)
list seek, peopleconnected, %%var
list delete, peopleconnected
else
WARN Var= %%var and is outside list range!@tab()
end
goto evloop
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
DoT_PiTcH Contributor

Joined: 07 Aug 2002 Posts: 85
|
Posted: Thu Dec 12, 2002 12:19 am Post subject: |
|
|
%%var is a username
there is a list with usernames
and when "you " dicconect i want it to remove the name from the list |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Dec 12, 2002 12:32 am Post subject: |
|
|
Well, then ya can't use LIST SEEK with it.
Use @match() to find it:
| Code: |
if @match(peopleconnected, %%var)
LIST DELETE, peopleconnected
end
|
BTW, try to use a little description in your topic name.
"hELP PLEASE" doesn't give much info for someone
scrolling thru the topics for help.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|