Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2007
    Posts
    452

    Star Dialog.Input Help #2

    Code:
    selString = Input.GetSelection("Input1");
    if selString ~= nil then
    link = Dialog.Input("WEB", "LINK:", "", MB_ICONQUESTION);
    text = Dialog.Input("LINK", "TEXT:", "", MB_ICONQUESTION);
    if (link ~= "CANCEL") then
    	tblSelected = Input.GetSelection("Input1") 
    	if tblSelected then
    		nPos = tblSelected.Start - 1
    		sLinkText = String.Mid(Input.GetText("Input1"), tblSelected.Start, tblSelected.End - tblSelected.Start + 1)
    	else
    		nPos = GetCaretPos("Input1")
    		sLinkText = text
    	end
    	if nPos == 0 then
    		Input.SetText("Input1", "{URL=\""..link.."\"]"..sLinkText.."{/URL]"..Input.GetText("Input1"))
    	elseif nPos == String.Length(Input.GetText("Input1")) then
    		Input.SetText("Input1",Input.GetText("Input1").. "{URL=\""..sLinkText.."\"]"..link.."{/URL]")
    	else
    		sBefore = String.Left(Input.GetText("Input1"), nPos)
    		if tblSelected then
    			sAfter = String.Mid(Input.GetText("Input1"), tblSelected.End + 1, -1)
    		else
    			sAfter = String.Mid(Input.GetText("Input1"), nPos + 1, -1)
    		end
    		Input.SetText("Input1", sBefore.."{URL=\""..link.."\"]"..sLinkText.."{/URL]"..sAfter)
    	end
    end
    else
    Dialog.Input("LINK", "TEXT:", selString, MB_ICONQUESTION);
    what's wrong with the code ???
    Last edited by GoOgLe; 03-23-2007 at 01:38 PM.

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Did you replace the { with [ and the } with ]

    When I posted I had to change to the other bracket so the forum wouldn't format the code.

  3. #3
    Join Date
    Mar 2007
    Posts
    452
    selString = Input.GetSelection("Input1");
    if selString then
    text = Dialog.Input("LINK", "TEXT:", selString, MB_ICONQUESTION);
    else
    text = Dialog.Input("LINK", "TEXT:", "", MB_ICONQUESTION);
    end

    link = Dialog.Input("WEB", "LINK:", "", MB_ICONQUESTION);
    if (link ~= "CANCEL") then

    tblSelected = Input.GetSelection("Input1")
    if tblSelected then
    nPos = tblSelected.Start - 1
    sLinkText = String.Mid(Input.GetText("Input1"), tblSelected.Start, tblSelected.End - tblSelected.Start + 1)
    else
    nPos = GetCaretPos("Input1")
    sLinkText = text
    end
    if nPos == 0 then
    Input.SetText("Input1", "{URL=\""..link.."\"]"..sLinkText.."{/URL]"..Input.GetText("Input1"))
    elseif nPos == String.Length(Input.GetText("Input1")) then
    Input.SetText("Input1",Input.GetText("Input1").. "{URL=\""..sLinkText.."\"]"..link.."{/URL]")
    else
    sBefore = String.Left(Input.GetText("Input1"), nPos)
    if tblSelected then
    sAfter = String.Mid(Input.GetText("Input1"), tblSelected.End + 1, -1)
    else
    sAfter = String.Mid(Input.GetText("Input1"), nPos + 1, -1)
    end
    Input.SetText("Input1", sBefore.."{URL=\""..link.."\"]"..sLinkText.."{/URL]"..sAfter)
    end
    end
    i tried that but it didnt work too
    Last edited by GoOgLe; 03-23-2007 at 02:07 PM.

  4. #4
    Join Date
    Mar 2007
    Posts
    452
    this is the error i get
    Attached Images

  5. #5
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Code:
    selString = Input.GetSelection("Input1");
    if selString then
    text = Dialog.Input("LINK", "TEXT:", String.Mid(Input.GetText("Input1"), selString.Start, selString.End - selString.Start), MB_ICONQUESTION);
    else
    text = Dialog.Input("LINK", "TEXT:", "", MB_ICONQUESTION); 
    end
    Last edited by Worm; 03-23-2007 at 02:25 PM.

  6. #6
    Join Date
    Mar 2007
    Posts
    452
    now i got this error when i select text
    Attached Images
    Last edited by GoOgLe; 03-23-2007 at 02:25 PM.

  7. #7
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    I mistyped... look at the code above, I edited to correct the error.

  8. #8
    Join Date
    Mar 2007
    Posts
    452
    thanks alot worm that worked

Similar Threads

  1. Dialog.Input Help Please
    By GoOgLe in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 03-23-2007, 01:22 PM
  2. Dialog.Input box help
    By bobbie in forum AutoPlay Media Studio 6.0
    Replies: 8
    Last Post: 12-06-2006, 01:28 PM
  3. Multi-line Dialog.Input?
    By Gabis in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 02-16-2006, 02:57 PM

Posting Permissions

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