This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

length of a variable

Old posts that have not been replied to for several years.
Locked
c
cvanmeer
Halfop
Posts: 40
Joined: Tue Dec 02, 2003 1:00 pm
Location: The Netherlands
Contact:

length of a variable

Post by cvanmeer »

Hi all,

I have a question.
Let's say I have a variable that outputs news posts.
But I only want to display the first 40 characters + "..."

example:
sifhkshsdlgksdg;lsfgjewpogjeposdopbnkhfsidfhsifoswiofsnfoiansfioan

must become:
sifhkshsdlgksdg;lsfgjewpogjepos...

or something like that.

can someone help me?

I've searched in the forum for something like this, but could not find anything.

thx

Chrizz
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Check the string range manual..
Once the game is over, the king and the pawn go back in the same box.
c
cvanmeer
Halfop
Posts: 40
Joined: Tue Dec 02, 2003 1:00 pm
Location: The Netherlands
Contact:

Post by cvanmeer »

I've checked it out be-4 I posted it here, I can't seem to make it work

could you give me an example script line?

thx
Chrizz
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

It's simple.. I have a line let's call it myline formed this "qwertyuiopasdfghjklzxcvbnm" .. this in tcl will be set myline "qwertyuiopasdfghjklzxcvbnm". Now I want to get from that line a range of characters from 0 to let's say 10, then I'll use "string range $myline 0 10" and I'll get as an result "qwertyuiopa"
Once the game is over, the king and the pawn go back in the same box.
c
cvanmeer
Halfop
Posts: 40
Joined: Tue Dec 02, 2003 1:00 pm
Location: The Netherlands
Contact:

Post by cvanmeer »

thx :)
Locked