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 


make list auto scroll

 
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: Thu Dec 12, 2002 11:31 pm    Post subject: make list auto scroll Reply with quote

how do i make a list auto scroll after so many lines
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 11:36 pm    Post subject: Reply with quote

This should keep the last item in view
(use your list name where "List1" is):
Code:

if @greater(@count(List1), 0)
   LIST SEEK, List1, @pred(@count(List1))
end

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: Fri Dec 13, 2002 5:26 am    Post subject: Reply with quote

Tahnks A lot

and one more thing

how would i limit the length of say

Code:

%%name = @input(enter name:

i want it to be only like 14 characters
Back to top
View user's profile Send private message Visit poster's website
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Fri Dec 13, 2002 5:36 am    Post subject: Reply with quote

Code:

EXTERNAL VDSINET.DLL, Public Freeware Key|90257236

option fieldsep," "
Title E C H O S I D E ltd Chat Client v1.1
  DIALOG CREATE,E C H O S I D E ltd Chat Client 1.1,-1,0,625,320,ontop,nosys
  DIALOG ADD,STYLE,S2,,6,,BLACK,YELLOW
  DIALOG ADD,STYLE,S1,,6,,BLACK,LTGREEN
  DIALOG ADD,MENU,File,&Save,&Connect,-,&Exit
  DIALOG ADD,MENU,Options,Settings,Commands
  DIALOG ADD,MENU,Help,&About
  DIALOG ADD,PROGRESS,CntnPrgrs,308,0,626,12
  DIALOG ADD,EDIT,Typehere,290,0,512,19,,S2
  DIALOG ADD,LIST,MSGBOARD,0,0,512,288,,,S1
  DIALOG ADD,LIST,users,0,512,112,288,,S1,sorted
  DIALOG ADD,BUTTON,Send,290,514,110,19,Send,,default
  DIALOG SHOW
%c = 0 
 
:Evloop

%%Nete = @Net(Socket,Event)
%e = @event()
if %e
goto %e
else
if %%Nete
goto %%nete
end

goto evloop


:Connect
goto evloop


:Closec
net Socket, SendServer, /leave %%nick
wait 1
exit


:error
goto evloop


:network
%%msg = @Net(Socket,Data)
parse "%%CMD;%%VAR", %%msg
if @equal(%%cmd, /nick)
goto populate
else
if @equal(%%cmd, /left)
goto DePopulate
else
if @equal(%%cmd, /NNick)
goto AIU
else
list add, MSGBOARD, @dlgtext(MSGBOARD)%%msg
end
goto Evloop


:SaveMENU
%%filename = @input(Save Session As:@tab()"("   Ex. chat1")")
list savefile, MSGBOARD, .\%%filename.txt
  goto evloop
 
 
:ExitMENU
  goto Close
 
 
:SettingsMENU
  goto evloop

 
:CommandsMENU
  goto evloop
 
:ConnectMENU
%%addr = @input(Server's IP Address :)
if @null(%%addr)
warn Nothing Was Entered! @cr()@cr()EX.  198.162.0.1
goto connectmenu
else
%%port = 415
Net Socket, Auto
Net Socket, VDSevents
Net Socket, port, %%port
Net Socket, Addr, %%addr
Net Socket, Client
%%nick = @input(Enter Desired Nick Name For Session: No Spaces!!!)
Net Socket, SendServer, /nick %%nick
goto evloop

 
:AboutMENU
  goto evloop
 
 
:SendBUTTON
Net Socket, sendserver,%%nick >" "@dlgtext(typehere)
DIALOG CLEAR, typehere
if @greater(@count(MSGBOARD), 0)
   LIST SEEK, MSGBOARD, @pred(@count(MSGBOARD))
end
goto evloop
 
:AIU
%%nick = @input(Enter Desired Nick Name For Session:)
Net Socket, SendServer, /nick %%nick
goto evloop

:Populate
%m = @match(users,%%var)
if @not(%m)
list add, users, %%var
else
end
goto evloop

:DePopulate
wait .3
%m = @match(users, %%var)
if %m
list delete, users, %%var
else
end
goto evloop

:Close
goto closec




here is a client i have been working on...
when i use the auto scroll it takes line 1 of the list adds it to line 2 and then add what i typed and so on and so on......
here is my server so you guys can figure something out maybe?
thanks for all the help...

Code:

EXTERNAL VDSINET.DLL, Public Freeware Key|90257236
Net Socket, Auto
Net Socket, VDSevents
net socket, addr, 127.0.0.1
Net Socket, port, 415
Net Socket, Server
option fieldsep, " "

Title Server
  DIALOG CREATE,Server,-1,0,194,243
  DIALOG ADD,LIST,Users,6,6,180,214
  DIALOG ADD,BUTTON,Closeconnection,222,6,180,16,Close Connection
  DIALOG SHOW
  list add, users, ES_ltd_SVR
 
 
 
 
 
 
 
:Evloop
%e = @event()
if %e
goto %e
else
%%Nete = @Net(Socket,Event)
if %%Nete
goto %%nete
end
goto evloop


:Accept
%%id = @Net(Socket, SENDERID)
Net Socket, Sendid, %%id, Welcome!
goto evloop


:Network
%%id = @Net(Socket, SENDERID)
%%msg = @Net(Socket,Data)
parse "%%cmd;%%Var", %%Msg
if @equal(%%Cmd, /nick)
Net Socket, sendall,%%msg|%%id
goto SetNick
else
if @equal(%%cmd, /leave)
%%id = @Net(Socket, SENDERID)
goto ClientDisconnect
else
Net Socket, Sendall, %%msg
goto evloop


:Error
goto Evloop


:closec
goto ClientDisconnect
:CloseconnectionBUTTON
Net Socket, close
  goto evloop
 
 
:ClientDisconnect
wait .3
%m = @match(users, %%var|%%id)
if %m
list delete, users, %m
Net Socket, Sendall, /left %%var|%%id
else
end
goto evloop


:SetNick
%%id = @Net(Socket, SENDERID)
%m = @match(users, %%var|%%id)
if %m
Net Socket, Sendid, %%id, /NNick
else
list add, users, %%var|%%id
%c = 0
%i = @count(users)
repeat
wait .6
Net Socket, sendid, %%id, %%cmd" "@item(users,%c)
%c = @fadd(%c,1)
until @equal(%c,%i)
end
goto Evloop



:Close
  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: Fri Dec 13, 2002 6:39 am    Post subject: Reply with quote

Only have a couple of minutes right now, but for
the name length try something like this:
Code:

:GetName
  %%name = @input(Enter your name:)
  if %%name
     if @greater(@len(%%name), 14)
        INFO Name is too long - 14 letters max...
        goto GetName
     end
  else
     if @ask(No name entered - try again?)
        goto GetName
     else
        rem -- exit, return to EVLOOP, or whatever --
     end
  end
  rem -- Use "exit" if this is a subprocedure --
  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
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Dec 13, 2002 6:24 pm    Post subject: Reply with quote

Do you want to use Mac's way of re-asking the name till it's good, or this 'automatic' way?

Code:
%%name = @substr(@input(Enter your name:),1,14)
Back to top
View user's profile Send private message
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Fri Dec 13, 2002 10:02 pm    Post subject: Reply with quote

thanks for the length thing....

but any ideas on the cumalitive list thing for the aut scroll
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: Fri Dec 13, 2002 10:20 pm    Post subject: Reply with quote

OK - couple of questions...

1. Why do ya want the list to autoscroll...
2. When do ya want the list to autoscroll...

If values are retrieved from the current list @item(),
LIST SEEK will make that item the current one. So
ya may have to store the @item() in a var before
trying to scroll to the end.

TOMMY: the source code is still wrapping for me
without the unbroken lines added...

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