Announcement

Collapse
No announcement yet.

Page Jump

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

  • Page Jump

    Hi guyes, look this code:

    Code:
    if e_Key == 13 then
      item_text = Input.GetText("btn_search");
      if (item_text ~= "") then
          Page.Jump(""..item_text.."");
      else
          Dialog.Message("Lorem Ipsum", "Lorem ipsum dolor sit amet.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
      end
    end

    How I can show dialogue if don't find the page?

  • #2
    There you go

    Code:
    if e_Key == 13 then
      item_text = Input.GetText("btn_search");
      pages = Application.GetPages();
      pages = Table.Concat(pages, ";", 1, TABLE_ALL);
      pages = ";" .. pages .. ";"
      find = String.Find(pages, ";" .. item_text .. ";", 1, false);
      if find ~= -1 then
      Page.Jump(""..item_text..""); 
      end
      
        
      if item_text == "" then
      Dialog.Message("Error", "Input page name!", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1); else
      
      Dialog.Message("Error", "Page not found!", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
      end
    end

    Comment


    • #3
      Thanks!

      Thanks your help!

      Code:
      -- search box
      if e_Key == 13 then
      	item_text = Input.GetText("box_search");
      	Page.Jump(""..item_text.."");
      
      	if item_text == "" then
      		Dialog.Message("Error", "Lorem Ipsum!", 0, 16, 0);
      	else
      		Dialog.Message("Error", "Lorem Ipsum Dolor!", 0, 16, 0);
      	end
      end

      Comment

      Working...
      X