Skip to content

Commit 263120c

Browse files
committed
SAMPLES: added samples
1 parent 0b1e0b3 commit 263120c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+9295
-0
lines changed

applications/CSV_Viewer.bas

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'
2+
' Using LOADLN,SPLIT
3+
'
4+
' This program displays an CSV file
5+
'
6+
TLOAD "mycsv.csv", A
7+
PRINT "Name";TAB(30);"e-mail"
8+
PRINT STRING$(47,"-")
9+
FOR L IN A
10+
SPLIT L, ",", B USE TRIM(x)
11+
IF LEN(B)<2 THEN EXIT ' For empty lines
12+
PRINT B(0);TAB(30);B(1)
13+
NEXT
14+
END

applications/Calendar.bas

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#sec:Main
2+
'
3+
' Calendar (PalmOS version)
4+
'
5+
const box=18
6+
const lmar=80-box*7/2
7+
const tmar=34
8+
dim ds(0 to 6),ms(12,2)
9+
for i=0 to 6 : read ds(i) : next
10+
data "Su","Mo","Tu","We","Th","Fr","Sa"
11+
for i=1 to 2 : for j=1 to 12 : read ms(j,i)
12+
next : next
13+
data "January","February","March","April","May","June","July","August","September","October","November","December"
14+
data 31,28,31,30,31,30,31,31,30,31,30,31
15+
repeat
16+
at 3,148
17+
input "Month,Year? ",ln$
18+
cls
19+
if ln$=0 then stop
20+
split ln$,"/,",v
21+
if len(v)=2 then
22+
m=val(v(0))
23+
y=val(v(1))
24+
d=(1461*(y+4800+(m-14)\12)\4+367*(m-2-12*((m-14)\12))\12-3*((y+4900+(m-14)\12)\100)\4+1)%7
25+
ms(2,2)=28+(y%4=0 and (y%100<>0 or y%400=0))
26+
n=ms(m,1)+" "+str$(y)
27+
at 1+(160-txtw(n)-len(n))/2,tmar/2-txth(n)
28+
print cat(1);n;cat(0)
29+
rem # of rows
30+
i=(ms(m,2)+d+6)\7
31+
rem verticals
32+
for n=0 to 7 : line lmar+box*n,tmar,lmar+box*n,tmar+box*i : next
33+
rem horizontals
34+
for n=0 to i : line lmar,tmar+box*n,lmar+box*7,tmar+box*n : next
35+
for n=0 to 6
36+
at lmar+1+box*n+(box-txtw(ds(n)))/2,tmar-2-txth(ds(n))
37+
print ds(n)
38+
next
39+
for i=0 to ms(m,2)-1
40+
row=(d+i)\7
41+
col=(d+i)%7
42+
n=str$(i+1)
43+
at lmar+1+box*col+(box-txtw(n))/2,tmar+1+box*row+(box-txth(n))/2
44+
print n
45+
next
46+
endif
47+
until

applications/Charmap.bas

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/local/bin/sbasic -g
2+
'
3+
' CHARMAP
4+
' 25/05/2000
5+
'
6+
cls
7+
ln=1
8+
for i=0 to 255
9+
if (i<>12) and (i<>27) and (i<>10) and (i<>13)
10+
? i;" ";chr$(i)+chr$(9);
11+
else
12+
? chr$(9);
13+
fi
14+
if ((i+1) mod 5) = 0 then
15+
?
16+
ln=ln+1
17+
if ( ln mod 14) = 0
18+
? "Pause...";
19+
pause
20+
?
21+
ln=1
22+
fi
23+
endif
24+
next

applications/Easter_Butcher.bas

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'
2+
' Easter-date calculator
3+
'
4+
? "Easter by the method of "+chr$(27)+"[1mButcher"+chr$(27)+"[21m"
5+
10 input "Enter a year : ",yr
6+
if yr=0 then 99
7+
ta=yr%19
8+
tb=yr\100
9+
tc=yr%100
10+
td=tb\4
11+
te=tb%4
12+
tf=(tb+8)\25
13+
tg=(tb-tf+1)\3
14+
th=(19*ta+tb-td-tg+15)%30
15+
ti=tc\4
16+
tk=tc%4
17+
tl=(32+2*te+2*ti-th-tk)%7
18+
tm=(ta+11*th+22*tl)\451
19+
day=th+tl-7*tm+114
20+
mon=day\31
21+
day=day%31+1
22+
if mon=3 then
23+
? "Sunday, March ";day;", ";yr
24+
else
25+
? "Sunday, April ";day;", ";yr
26+
fi
27+
goto 10
28+
99 end
29+
30+

applications/Easter_Carter.bas

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'
2+
' Easter date calculator
3+
'
4+
? "Easter by the method of "+chr$(27)+"[1mCarter"+chr$(27)+"[21m"
5+
10 input "Enter a year : ",yr
6+
if yr=0 then 99
7+
if yr<1900 or yr>2099 then 89
8+
tb=225-11*(yr%19)
9+
td=(tb-21)%30+21
10+
te=(yr+yr\4+td+1)%7
11+
day=td+7-te
12+
if day<32 then
13+
? "Sunday, March ";day;", ";yr
14+
else
15+
? "Sunday, April ";day-31;", ";yr
16+
fi
17+
goto 10
18+
89 ? "1899 < year < 2100"
19+
goto 10
20+
99 end
21+

applications/Easter_Oudin.bas

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'
2+
' Easter-date calculator
3+
'
4+
? "Easter by the method of "+chr$(27)+"[1mOudin"+chr$(27)+"[21m"
5+
10 input "Enter a year : ",yr
6+
if yr=0 then 99
7+
tc = yr\100
8+
tg = yr%19
9+
tk = (tc-17)\25
10+
tl = (tc-tc\4-(tc-tk)\3+19*tg+15)%30
11+
tla=tl\28
12+
tlb=29\(tl+1)
13+
tlc=(21-tg)\11
14+
tl=tl-tla*(1-tla*tlb)*tlc
15+
tj=(yr+yr\4+tl+2-tc+tc\4)%7
16+
tl=tl-tj
17+
month=3+(tl+40)\44
18+
day=tl+28-31*(month\4)
19+
if month=3 then
20+
? "Sunday, March ";day;", ";yr
21+
else
22+
? "Sunday, April ";day;", ";yr
23+
fi
24+
goto 10
25+
99 end

0 commit comments

Comments
 (0)