Long URL in a field

Sarah Reichelt sarah.reichelt at gmail.com
Sun Jun 13 18:51:07 CDT 2010


On Mon, Jun 14, 2010 at 6:33 AM, Emmett Gray <film2 at handheldfilm.com> wrote:
> In the HC version of a stack I've converted, I have a "notes" text field.
> The field has a vertical scroll bar, but not a horizontal one (and that's
> what I want). In HC, a long URL will wrap so you can see the whole thing on
> multiple lines. In Rev, it doesn't wrap so you can't see it all (although
> you can still select it by dragging to the right). Can this behavior be
> changed to be like in HC (i.e. force a line with no spaces to wrap)?

No, wrapping on Rev only works with white space.
So I wrote a routine to space out a long URL to fit a specific field:

command formatFolderPath pFieldName
     repeat while the formattedWidth of fld pFieldName >= the width of
fld pFieldName
          -- find the last slash & replace with slash & cr
          put the text of fld pFieldName into tFolder
          repeat with x = the number of chars in tFolder down to 1
               if char x of tFolder = slash and char x+1 of tFolder <> cr then
                    put cr after char x of tFolder
                    put tFolder into fld pFieldName
                    exit repeat
               end if
          end repeat
     end repeat
end formatFolderPath

Then when using the file path, you just need to make sure you replace
cr with empty and you get back to the original.
There are obvious improvements that could be made, but for a quick
fix, it works OK.

-- 
Cheers,
Sarah

Rodeo discussion:
http://rodeoapps.com/rodeo-discuss-among-yourselves



More information about the use-livecode mailing list