+ Reply to Thread
Results 1 to 3 of 3

Thread: Clamp derma text box length

  1. #1
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Clamp derma text box length

    Is there anyway to clamp a DTextEntry's max length of characters? I cant seem to find anything on it.

  2. #2
    Wire Sofaking N00bDud3's Avatar
    Join Date
    Jul 2009
    Location
    Error: Unknown Location
    Posts
    1,252

    Default Re: Clamp derma text box length

    I'm not sure, as I'm not that great with LUA, but a short workaround would be to take only the first X characters, and discard the rest. There may be a way to force it to not go over though. Probably could take the input with another script first, then if the length is too high, don't send it to the box.



  3. #3
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,346
    Blog Entries
    3

    Default Re: Clamp derma text box length

    Code:
    function TextBox.OnTextChanged()
    	if string.len(TextBox:GetValue()) > 9001 then
    		TextBox:SetValue(string.Left(TextBox:GetValue(), 9001))
    	end
    end
    Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
    Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
    Drunkie - Logically, Jat Goodwin must be a fist pumping guido.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots