Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 31
  1. #1
    Join Date
    Mar 2007
    Posts
    452

    Input Search Help

    I used KEYSTROKES.DLL and put all the codes but it didnt work !!!

    Global Functions :

    Code:
    function SendKeys(sSendString)
    	sSendString = "\"" ..sSendString.."\""
    	result = DLL.CallFunction(_SourceFolder.. "\\AutoPlay\\Docs\\dll\\KEYSTROKES.DLL", "KEYSTROKE", sSendString, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL)
    end
    Button On Click Event :

    Code:
    Page.SetFocus("Input1");
    --send Control F
    SendKeys("\"^f\"")

    Why ???

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    that search function dosent work in a inout object, all it dose is calls the native ie search dialog from within the webobject
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Mar 2007
    Posts
    452
    how can i do search in input object ???

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    use String.Find and Input.SetSelection, with some clever code you can achive the same kind of thing
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    Mar 2007
    Posts
    452
    Code:
    strText = Input.GetText("Input1");
    search = Input.GetText("Input4");
    strText = String.Find(strText, search, 1, true);
    Input.SetSelection("Input1", 1, -1, search);
    can u help with it please ???
    Last edited by GoOgLe; 03-26-2007 at 05:20 AM.

  6. #6
    Join Date
    Mar 2007
    Posts
    452

    Grin

    Code:
    strText = Input.GetText("Input1");
    search = Input.GetText("Input4");
    result = String.Find(strText, search, 1, true);
    Input.SetSelection("Input1", 1, -1, result);
    that works but selects all the text in input1 !!!!

  7. #7
    Join Date
    Mar 2007
    Posts
    452

    Peekaboo!

    can someone help me please ????

  8. #8
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Try this...

    Code:
    strText = Input.GetText("Input1");
    search = Input.GetText("Input4");
    searchlen = String.Length(search);
    result = String.Find(strText, search, 1, true);
    Input.SetSelection("Input1", result, result + searchlen -1);

  9. #9
    Join Date
    Mar 2007
    Posts
    452
    thanks mwreyf1 that works good but how can i get the next result...

    what i mean is if there r more then 1 result in input1 how will i jump the next one ???

  10. #10
    Join Date
    May 2006
    Posts
    5,380
    start from the end of last search string

    result = String.Find(strText, search+1, 1, true);

    or something like that, im not on my dev pc and ams wont run properly on my laptop, so i cant test it
    Open your eyes to Narcissism, Don't let her destroy your life!!

  11. #11
    Join Date
    Mar 2007
    Posts
    452
    i got an error
    Attached Images

  12. #12
    Join Date
    May 2006
    Posts
    5,380
    like i said, im not in a position to test it

    try

    result = String.Find(strText, searchlen+1, 1, true);


    but i think its going to take a lot more code than that,

    the code you have is ok to fine the frist word, then there is text selected, so use that to make your next block of code "if selected then" and start the search from the end of the selected text
    Open your eyes to Narcissism, Don't let her destroy your life!!

  13. #13
    Join Date
    Mar 2007
    Posts
    452
    Code:
    strText = Input.GetText("Input1");
    search = Input.GetText("Input4");
    searchlen = String.Length(search);
    result = String.Find(strText, search, 1, true);
    Input.SetSelection("Input1", result, result + searchlen -1);
    
    
    selString = Input.GetSelection("Input1");
    if selString then
    strText = Input.GetText("Input1");
    search = Input.GetText("Input4");
    searchlen = String.Length(search);
    result = String.Find(strText, searchlen+1, 1, true);
    Input.SetSelection("Input1", result, result + searchlen -1);
    end
    i tried that it finds the first result and blocks it but when i click again it unblocks the result it doesnt research for the next result !!!!!

  14. #14
    Join Date
    Mar 2007
    Posts
    452
    can someone help with the code please ???

  15. #15
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    The following code comes from the IR Project Code Viewer which has a search function in the On Key event for the page. This code uses CTRL+F to start the search and then F3 to step to the next occurance. You can find the project from my sig below to see the working code.

    HTH

    Code:
    --CTRL+F initiate search dialog
    if e_Key == 70 and e_Modifiers.ctrl then
    	sSearch = String.TrimRight(Dialog.Input("Enter Search String", "Enter the string for which you want to search."), nil);
    	if sSearch ~= "" and sSearch ~= "CANCEL" then
    		local sInputString = Input.GetText("Input2");
    		nPos = String.Find(sInputString, sSearch, 1, false);
    		if nPos ~= -1 then
    			Input.SetSelection("Input2", nPos, nPos+String.Length(sSearch)-1);
    			Application.Sleep(100);
    			local tbSel = Input.GetSelection("Input2");
    			Input.ScrollToLine("Input2", tbSel.LineNum);
    			bFound = true;
    		else
    			Dialog.Message("Info", "No occurances found.");
    			bFound = false;
    		end
    	end
    end
    
    if bFound then
    	--F3 find next dialog
    	if e_Key == 114 then
    		if sSearch ~= "" and sSearch ~= "CANCEL" then
    			local sInputString = Input.GetText("Input2");
    			nPos = String.Find(sInputString, sSearch, 1, false);
    			if nPos ~= -1 then
    				Input.SetSelection("Input2", nPos, nPos+String.Length(sSearch)-1);
    				Application.Sleep(100);
    				local tbSel = Input.GetSelection("Input2");
    				Input.ScrollToLine("Input2", tbSel.LineNum);
    				bFound = true;
    			else
    				Dialog.Message("EOF", "The End of the file has been reached.");
    				bFound = false;
    			end
    		end
    	end
    end
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Input Box Wierdness
    By Roboblue in forum AutoPlay Media Studio 6.0
    Replies: 9
    Last Post: 11-18-2005, 01:20 PM
  2. Lorne’s two great input validation scripts
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 06-09-2004, 09:13 AM
  3. SQLITE Search on CD
    By perry_d76 in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 03-31-2004, 08:36 PM
  4. Cancelling File Search
    By pjborg in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 06-23-2003, 01:49 AM
  5. File Search
    By Jan Fr. Nordbakke in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-14-2001, 03:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts