Announcement

Collapse
No announcement yet.

How ignore the input when starts with 0?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Imagine Programming
    replied
    Code:
    String.TrimLeft(szInputString, "0 ");
    This will trim 0's and spaces from the left.

    Leave a comment:


  • gutierrez100
    started a topic How ignore the input when starts with 0?

    How ignore the input when starts with 0?

    How ignore the input when starts with 0?

    Eg: if I put 23 or 023 or 00023 the function goes to page 23.
    I'm using input box with mask #####

    Code:
    -- search box
    function boxSearch()
    	idBox = Input.GetText("box_search");
    	idToNumber = String.ToNumber(idBox);
    	pnToNumber = String.ToNumber(page_name);
    
    	if pnToNumber == idToNumber then
    		Dialog.Message("Attention!", "The page is already active!", 0, 64, 0);
    		Page.SetFocus("box_search");
    	end
    
    	Page.Jump(""..idToNumber.."");
    
    	if idToNumber ~= "" then
    		Dialog.Message("Error!", "ID not found!", 0, 64, 0);
    		Page.SetFocus("box_search");
    	end
    end
Working...
X