View previous topic :: View next topic |
Author |
Message |
dalton
Joined: 26 Jan 2012 Posts: 30
|
Posted: Sat Feb 25, 2012 8:03 am Post subject: few question |
|
|
1. I want set a var value by alias,and use it in a action,but fail.
#alias bookname {#var bookname %1;}
#ac {blabla} {#var $bookname[$num] $content}
the bookname and content,num have right value ,action works.
2.I learn more from the script http://tintin.sourceforge.net/scripts/itemlist.php,but I dunno why do this first:
#system echo -n "" > items.tin;
the file items.tin begin with "-n",and after I read it sth wrong,the tt cannt work.
#read items.tin
#sh $itemlist
#NO SESSION ACTIVE. USE: -session {name} {host} {port} TO START ONE.
and i found none tt cmd can run,just can do ctrl-d to exit. |
|
Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3842
|
Posted: Sat Feb 25, 2012 8:42 pm Post subject: |
|
|
That's intended to clear the file. Guess you'll have to find an alternative means. |
|
Back to top |
|
 |
dalton
Joined: 26 Jan 2012 Posts: 30
|
Posted: Mon Feb 27, 2012 6:33 am Post subject: |
|
|
hmm,i see.
but my first question ?? |
|
Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3842
|
Posted: Mon Feb 27, 2012 6:44 pm Post subject: |
|
|
I'm not sure what the question is. |
|
Back to top |
|
 |
dalton
Joined: 26 Jan 2012 Posts: 30
|
Posted: Tue Feb 28, 2012 5:56 am Post subject: |
|
|
haha,sorry ,my poor english.
there are 4 books , and i want to write a script to record the book name,book index,and book content(every page),and store in 4 var .
example,book 1 ,named zhuangzi ,then i use a alias set the var "bookname" to zhuangzi first.
#alias bookname {#var bookname %1};
bookname zhuangzi
and write a action recored every page ,store name ,index,contents in the var "zhuangzi"
so like this :
#ac {^==%s%*%s==$}
{
#var content %1;
#var pagenum $pagenum +1;
#var $bookname[$pagenum] $content;
}
I want to get a var named zhuangzi and store one page content in "zhuangzi[$pagenum]"
when action triggered,I think it should be : #var zhuangzi[$pagenum] $content, but "#var $bookname[$pagenum] $content;" not work .
what's wrong ? |
|
Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3842
|
Posted: Tue Feb 28, 2012 8:06 am Post subject: |
|
|
That won't work because tintin will treat $bookname[$pagenum] as one variable.
Try:
Code: |
#alias {setbook}
{
#var %1[%2] %3
}
setbook {$bookname} {$pagenum} {$content}
|
|
|
Back to top |
|
 |
dalton
Joined: 26 Jan 2012 Posts: 30
|
Posted: Wed Feb 29, 2012 6:11 am Post subject: |
|
|
ok,i know,this better. |
|
Back to top |
|
 |
|