Browse Search Popular Register Upload Rules User list Login:
Search:
Strings functions (Thyme)

Image:
screenshot of the scene

Author: REMqb

Group: Default

Filesize: 1.86 kB

Date added: 2010-02-27

Rating: 5.6

Downloads: 477

Views: 1123

Comments: 1

Ratings: 2

Times favored: 0

Made with: Algodoo before v1.8.5

Tags:

Scene tag

/!\ you can get a better description here : http://www.algodoo.com/forum/viewtopic.php?f=13&p=18300#p18300

This scene contains only basic functions to manipulate strings variables.
Why this scene? Because, for example in algodoo there is no functions which allow you to get a part of a classic text variable.

String format : (All my functions use this format)

[string Length, string elements]
example : [11,["H","e","l","l","o"," ","W","o","r","l","d"]]

Functions list, speed and limit : (You have to add "Scene.my." before the name of all functions)
-strCat([str1], [str2]) : Concatenate [str1] with [str2]. Return : [string] (fast) (no limit)

-strLen([str]) : Return the length of [str]. Return : [number] (fast) (no limit)

-strToText([str]) : Convert [str] into classic text. Return : [text] (slow) (strings about 400 chars) Note : Don't put {Scene.my.strToText(str)} in the text variable of a box because this will slow down the simulation.

-subStr([str], [start], [length]) : Return the chars wich are in [str] between start to start+length. Return : [string] (slow) (strings about 400 chars)

-addChar([str], [char], [place]) : Return [str] with [char] inserted at position [place]. Return : [string] (fast for place = 0 and place = Scene.my.strLen(str) slow for others places) (no limit for place = 0 and place = Scene.my.strLen(str), strings about 400 chars for others places)

-charToStr([char]) : Convert [char] into a string of length = 1. Return : [string] (fast) (only one char)

-subChar([str], [place]) : Return [str] without the char at position [place]. Return : [string] (slow) (strings about 400 chars)

-getChar([str], [pos]) : Return the char wich is at position [pos] in [str]. Return : [text] (fast) (no limit)

-setChar([str], [char], [pos]) : Replace the char at position [pos] in [str] by [char]. Return : [string] (slow) (strings about 400 chars)

(slow) mean that bigger will be the string, slower will be the function.

The limit of strings about 400 char is due to the for function used in this script (I used the one you can get at http://www.algodoo.com/forum/viewtopic.php?f=13&t=411)
Please if you have a for function wich handle bigger numbers (and if possible wich is faster) or other string functions ideas tell me.
If you use theses functions, please give me credit.
If you found some bugs, I'll try to fix them.:)
If my English is bad, I apologize.

My text to algodoo string tool : http://lh62have.free.fr/algodoo/ (Updated)

Known bugs(s) :
-You can't use the char ] alone (You can try to type "]" in console, you'll get an error)

This scene can be used as phunlet and should work in phun :) .
Last edited at 2010/02/28 15:11:05 by REMqb
Please log in to rate this scene
edit
Similar scenes
Title: Thyme String Functions
Rating: 6.1111
Filesize: 109.4 kB
Downloads: 624
Comments: 5
Ratings: 3
Date added: 2025/08/31 04:39:45
Made with: Algodoo v2.2.3
Rating: rated 6.1
download
Title: thyme scripted pneumatic cylinder
Rating: 7
Filesize: 14.73 kB
Downloads: 958
Comments: 4
Ratings: 8
Date added: 2010/11/30 22:24:38
Made with: Phun
Rating: rated 7
download
Title: Bass Guitar Demo
Rating: 6.1111
Filesize: 2.67 MB
Downloads: 1641
Comments: 15
Ratings: 3
Date added: 2014/05/26 08:25:10
Made with: Algodoo v2.1.0
Rating: rated 6.1
download
Title: New Project: Gibson Les Paul
Rating: 4.25
Filesize: 262.35 kB
Downloads: 305
Comments: 2
Ratings: 4
Date added: 2009/03/13 18:59:58
Made with: Phun
no image found for this scene
Rating: rated 4.3
download
Title: Sine and Cosine visualized
Rating: 5
Filesize: 45.89 kB
Downloads: 1172
Comments: 18
Ratings: 1
Date added: 2022/09/05 04:41:07
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Mouse over polygon effect
Rating: 5
Filesize: 5.09 kB
Downloads: 1226
Comments: 2
Ratings: 1
Date added: 2012/12/11 12:58:30
Made with: Algodoo v2.0.2 Edu
Rating: rated 5
download
REALY THANKS!!!!! you have helped me with my computer!:lol:

i may continue with my PC's:lol: