[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] how to get number of characters in a string?
On Sun, 2002-09-08 at 13:30, Philip S. Hempel wrote:
> I was attempting to find a way to
> determine the number of characters that
> are in a string.
>
> I am making a templete and was passing
> a variable to title-bar and wanted to
> not use the width that came from the
> table push. I want to add 10 more
> points to the width (or however many
> I choose).
>
> [calc]
> my $n = [control
> title_bar];
>
> $Scratch->{title_bar_width} = int( $n +
> 10 );
> return;
> [/calc]
>
>
> [title-bar [scratch title_bar_width] 3
> green]<center>[control
> title_bar]</center>[/title-bar]
>
>
>
>
> I grabbed this from some other component
> and ussed it as a foundation.
>
> I knew from the start this is wrong
> but I don't know of any tag that would
> do this and thought at least this would
> begin what I was looking for.
somthing like this perhaps?
this would calc length+10;
[calc]
my $len = length([control title_bar]);
$Scratch->{title_bar_width} = $len + 10;
return;
[/calc]
this would actually make it 10 longer...
[calc]
my $title_bar = [control title_bar];
for(my n = 10; n--; n>=0){
$title_bar .= ' ';
}
return $title_bar;
[/calc]
>
> Thanks
> --
> -------------------------
> Philip S. Hempel
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
--
-------------------------------------------
| Caleb Phillips |
| The Studio Resource |
| IT Specialist |
| |
| Handcrafted for you in Ximian Evolution |
-------------------------------------------