Re: TIB: String command??


[Prev][Next][Index][Thread]

Re: TIB: String command??



Try my program, Planner 1.5, which will be available at the start of the
school year. It will have the ability to use one string and one list to have
as many pages of 8 tasks that memory can support.

Here is the source code for it, just to give you a rough idea.

The prog is for the 86.
-- 
o w e n  c a n n o n
ocannon@oregonvos.net
www.oregonvos.net/~ocannon


> From: "Simon Trimble" <gingerno1@hotmail.com>
> Reply-To: ti-basic@lists.ticalc.org
> Date: Thu, 24 Aug 2000 20:30:47 BST
> To: ti-basic@lists.ticalc.org
> Subject: TIB: String command??
> 
> 
> Does anyone know how i can 'grab' a character from a string at whatever
> place i specify it to get it at....
> 
> E.g.
> Theoretically speaking...
> 
> 'hello there'=>a
> grab('a',3)=>b
> print b
> 
> these lines of code should return the first letter 'l' from the string
> stored in 'a'  (The '3' means 3 characters along).
> 
> And heres another example...
> 
> 'hello there'=>a
> grab('a',7)=>b
> print b
> 
> These lines of code should print the letter 't' (The 7'th character along
> the string).
> 
> Tell me if you need more info.
> 
> Thanks,  Simon.
> 
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> 
> 
> 

"Planner"ªÆappname 
"New Item"ªÆprompt
Æsªolds
Ælªoldl

Æload cldrw
text(0,0,Æappname
text(0,70,"page:"
text(6,3,"1"
text(12,3,"2"
text(18,3,"3"
text(24,3,"4"
text(30,3,"5"
text(36,3,"6"
text(42,3,"7"
text(48,3,"8"
stpic Æcliosrc
goto topsrc


lbl top
cldrw
rcpic Æcliosrc

lbl topsrc
text(0,90,Æmathdat(1))
ÆlªÆl2
(Æmathdat(1)*8)ªdiml Æl
ÆlªÆl1

(diml Æl1)-1ªdiml Æl1
text(48,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))
(diml Æl1)-1ªdiml Æl1
text(42,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))
(diml Æl1)-1ªdiml Æl1
text(36,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))
(diml Æl1)-1ªdiml Æl1
text(30,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))
(diml Æl1)-1ªdiml Æl1
text(24,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))
(diml Æl1)-1ªdiml Æl1
text(18,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))
(diml Æl1)-1ªdiml Æl1
text(12,9,sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1)))

if Æmathdat(1)==1
then
text(6,9,sub(Æs,1,Æl(1)))
Æl2ªÆl1
else
(Æmathdat(1)*8)-8ªdiml Æl
sum ÆlªÆl3
Æl2ªÆl
text(6,9,sub(Æs,Æl3+1,Æl(Æmathdat(1)*8-7)))
Æl2ªÆl1
end

menu(1,"Close",exit,2,"<--",pageup,3,"add",add,4,"erase",done,5,"-->",pagedown,6,"copy",copy,7,"paste",paste,8,"?",help,9,">page",go


lbl moo
if Æl(diml Æl-1)­1 and ((Æmathdat(1)-1)*8)+8==temp1
then
sub(Æs,1,(lngth Æs-Æl(diml Æl)))+tempªs
lngth tempªÆl(diml Æl)
goto top
end
ÆlªÆl1
0ªtemp4
for(temp2,1,temp1)
Æl(temp2)+temp4ªtemp4
end
delvar(Æl1)
temp4ªÆl1
if temp1>1
then
sub(Æs,1,Æl1-Æl(temp1))ªÆs1
sub(Æs,Æl1+1,lngth Æs-(Æl1))ªÆs2
Æs1+temp+Æs2ªÆs
lngth tempªÆl(temp1)
else
sub(Æs,Æl(1)+1,(lngth Æs)-Æl(1))ªÆs1
lngth tempªÆ(1)
end
ÆlªÆl1
goto top

lbl add
Ænewtask
lbl addother
if diml Æl<(8*Æmathdat(1))
then
Æs+"        "ªs
aug(Æl,{1,1,1,1,1,1,1,1})
end
((Æmathdat(1)-1)*8)+1ªtemp1
if Æl(temp1)==1
then
goto moo
end
if Æl(temp1+1)==1
then
temp1+1ªtemp1
goto moo
end
if Æl(temp1+2)==1
then
temp1+2ªtemp1
goto moo
end
if Æl(temp1+3)==1
then
temp1+3ªtemp1
goto moo
end
if Æl(temp1+4)==1
then
temp1+4ªtemp1
goto moo
end
if Æl(temp1+5)==1
then
temp1+5ªtemp1
goto moo
end
if Æl(temp1+6)==1
then
temp1+6ªtemp1
goto moo
end
if Æl(temp1+7)==1
then
temp1+7ªtemp1
goto moo
end
goto top

lbl done
" "ªtemp
menu(1,"<<",top,2,"1",doneone,2,"2",doneone,3,"3",doneone,4,"4",doneone,5,"5",doneone,6,"6",doneone,7,"7",doneone,8,"8",doneone

lbl doneone
((Æmathdat(1)-1)*8)+1ªtemp1
goto moo
lbl donetwo
((Æmathdat(1)-1)*8)+2ªtemp1
goto moo
lbl donethr
((Æmathdat(1)-1)*8)+3ªtemp1
goto moo
lbl donefor
((Æmathdat(1)-1)*8)+4ªtemp1
goto moo
lbl donefiv
((Æmathdat(1)-1)*8)+5ªtemp1
goto moo
lbl donesix
((Æmathdat(1)-1)*8)+6ªtemp1
goto moo
lbl donesev
((Æmathdat(1)-1)*8)+7ªtemp1
goto moo
lbl doneeig
((Æmathdat(1)-1)*8)+8ªtemp1
goto moo

lbl pageup
if Æmathdat(1)³2
Æmathdat(1)-1ªÆmathdat(1)
goto top
lbl pagedown
Æmathdat(1)+1ªÆmathdat(1)
if diml Æl<(8*Æmathdat(1))
then
Æs+"        "ªs
aug(Æl,{1,1,1,1,1,1,1,1})ªÆl
end
goto top


lbl exit
Æunload
return


lbl copy
ÆlªÆl1
menu(1,"<<",top,2,"1",copyone,2,"2",copyone,3,"3",copyone,4,"4",copyone,5,"5",copyone,6,"6",copyone,7,"7",copyone,8,"8",copyone

lbl copyone
if Æmathdat(1)>1
then
((Æmathdat(1)-1)*8)+0ªdiml Æl1
sub(Æs,(sum Æl1)+1,Æl(diml Æl1+1))ªclip
else
sub(Æs,1,Æl(1))ªclip
end
goto top

lbl copytwo
((Æmathdat(1)-1)*8)+1ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top

lbl copythr
((Æmathdat(1)-1)*8)+2ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top

lbl copyfor
((Æmathdat(1)-1)*8)+3ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top

lbl copyfiv
((Æmathdat(1)-1)*8)+4ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top

lbl copysix
((Æmathdat(1)-1)*8)+5ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top

lbl copysev
((Æmathdat(1)-1)*8)+6ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top

lbl copyeig
((Æmathdat(1)-1)*8)+7ªdiml Æl1
sub(Æs,(sub Æl1)+1,Æl(diml Æl1+1))ªclip
goto top


lbl paste
clipªtemp
goto addother


lbl help
goto top

References: