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 


Edit (how can i limit the amount of chars?)

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


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Mon Apr 28, 2003 10:35 am    Post subject: Edit (how can i limit the amount of chars?) Reply with quote

How can i limit the amount of input an edit box can take?
I want to make say edit 1 accept no more then 255 chars input.
Back to top
View user's profile Send private message
Skit3000
Admin Team


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

PostPosted: Mon Apr 28, 2003 11:13 am    Post subject: Reply with quote

I believe there is an sendmessage for that. I don't know why, maybe you should try to search the forum for it...
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Mon Apr 28, 2003 12:47 pm    Post subject: Reply with quote

I though i could use sendmessage but that bring me to the question whats the Windows API code that goes in there? I only know how to make a list box have scrolls, thats the limit to my API.

Any help please?
Back to top
View user's profile Send private message
Skit3000
Admin Team


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

PostPosted: Mon Apr 28, 2003 12:55 pm    Post subject: Reply with quote

That's what I said, search first... Wink

http://forum.vdsworld.com/viewtopic.php?t=1316

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Mon Apr 28, 2003 1:21 pm    Post subject: Reply with quote

I admit i only did a quick search since i was not sure what i was looking for exactly.

Thank you for your help though.
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Apr 28, 2003 6:37 pm    Post subject: Reply with quote

I think I posted an example a year or so back that limits the text
without using the @sendmsg(). I think a couple of other people also
did small examples in the same thread as where I posted my example.

It was simply a loop where it kept checking the @len(@dlgtext(EDIT1))
and if was over the limit, it would cut off any text beyond the limit.

This is actually very simple, well, to me it is. If you can't figure it out,
just say so, and I'll make another example and post here for you.

-Garrett
Back to top
View user's profile Send private message
Skit3000
Admin Team


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

PostPosted: Mon Apr 28, 2003 6:51 pm    Post subject: Reply with quote

Probably something like this...

Code:
DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,EDIT,EDIT1,89,49,,,EDIT1
  DIALOG SHOW

:Evloop
wait event,0.1
goto @event()
 
:Timer
dialog set,edit1,@substr(@dlgtext(edit1),1,10)
goto Evloop
 
:Close
exit

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Apr 28, 2003 7:29 pm    Post subject: Reply with quote

I was searching for the old posts on this, but I think they may have been
prior to this forum being setup. So here's a new example for you:


Code:
  DIALOG CREATE,Limit Input,-1,0,212,53
  DIALOG ADD,EDIT,EDIT1,16,14,180,19,EDIT1
  DIALOG SHOW
  Option Sleeptime,100
  %%InLimit = 10

:EventLoop
  Wait Event,0
  Goto @event()

:Close
  Exit

:Timer
  If @greater(@len(@dlgtext(EDIT1)),%%InLimit)
    Dialog Set,EDIT1,@substr(@dlgtext(EDIT1),1,%%InLimit)
    WARN "You have exceeded the limit of this entry.  Entry truncated to fit within entry limits."
  End
  Goto EventLoop


-Garrett
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Apr 28, 2003 7:43 pm    Post subject: Reply with quote

I posted an example just for this in the knowledge base a while ago!

http://forum.vdsworld.com/viewtopic.php?t=1316

It has an example and everything you need. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


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

PostPosted: Tue Apr 29, 2003 7:38 am    Post subject: Reply with quote

That's where I got that API message from... Wink
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Tue Apr 29, 2003 1:00 pm    Post subject: Reply with quote

Thank you, I have managed to do what i was doing with my edit box.
Back to top
View user's profile Send private message
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