From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kommander/examples/tutorial/strings.kmdr | 206 +++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 kommander/examples/tutorial/strings.kmdr (limited to 'kommander/examples/tutorial/strings.kmdr') diff --git a/kommander/examples/tutorial/strings.kmdr b/kommander/examples/tutorial/strings.kmdr new file mode 100644 index 00000000..1ef6a953 --- /dev/null +++ b/kommander/examples/tutorial/strings.kmdr @@ -0,0 +1,206 @@ + +Form1 + + + Form1 + + + + 0 + 0 + 522 + 447 + + + + String functions + + + + + + + + + + + unnamed + + + 11 + + + 6 + + + + TextEdit1 + + + true + + + @Array.setValue(Bool, 1, yes) +@Array.setValue(Bool, 0, no) + +<h2>Kommander string functions</h2> +<b>Length:</b> @String.length("@LineEdit1")<br> +<b>First 5 chars:</b> @String.left("@LineEdit1", 5)<br> +<b>Last 5 chars:</b> @String.right("@LineEdit1", 5)<br> +<b>Chars from 6th to 10th:</b> @String.mid("@LineEdit1", 6, 5)<br> +<b>Remove spaces:</b> @String.remove("@LineEdit1", " ")<br> +<b>Replace spaces with *</b>: @String.replace("@LineEdit1", " ", *)<br> +<b>Uppercase:</b> @String.upper("@LineEdit1")<br> +<b>Lowercase:</b> @String.lower("@LineEdit1")<br> +<b>Is a number?:</b> @Array.value(Bool, @String.isNumber("@LineEdit1"))<br> +<b>Is empty?</b> @Array.value(Bool, @String.isEmpty("@LineEdit1"))<br> +<b>Contains "Kommander"?:</b> @String.contains("@LineEdit1", "Kommander")<br> +<b>Position of "Kommander":</b> @String.find("@LineEdit1", "Kommander")<br> +<b>Compare with "Kommander":</b> +@execBegin +if [ @String.compare("@LineEdit1", "Kommander") -lt 0 ];then + echo "Less than Kommander<br>" +elif [ @String.compare("@LineEdit1", "Kommander") -gt 0 ];then + echo "Greater than Kommander <br>" +elif [ @String.compare("@LineEdit1", "Kommander") -eq 0 ];then + echo "Equals Kommander <br>" +fi +@execEnd +<b>Case insensitive match with "Kommander":</b> +@execBegin +if [ @String.compare(@String.lower("@LineEdit1"), "kommander") -eq 0 ];then + echo "Match found<br>" +else + echo "Match failed<br>" +fi +@execEnd + + + + + + + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel1 + + + Enter str&ing here: + + + LineEdit1 + + + + + LineEdit1 + + + I love Kommander! + + + + @widgetText + + + + + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + Spacer1 + + + Horizontal + + + Expanding + + + + 30 + 0 + + + + + + ExecButton1 + + + &Test + + + + + + + + + + + + + Spacer2 + + + Horizontal + + + Expanding + + + + 30 + 0 + + + + + + + + + + ExecButton1 + clicked() + TextEdit1 + populate() + + + + LineEdit1 + ExecButton1 + TextEdit1 + + + -- cgit v1.2.3