forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


hELP PLEASE

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Wed Dec 11, 2002 10:41 pm    Post subject: hELP PLEASE Reply with quote

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
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Dec 11, 2002 11:03 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Thu Dec 12, 2002 12:19 am    Post subject: Reply with quote

%%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
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Dec 12, 2002 12:32 am    Post subject: Reply with quote

Well, then ya can't use LIST SEEK with it. Smile

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. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group