; vote.seg.s ; modified for ACOS on 03/30/87 public fromsys on nocar goto no.car kill "l:variables":store "l:variables" goto start fromsys on nocar goto no.car goto start no.car clear:recall "l:variables" link "a:main.seg","term1" link.main clear:recall "l:variables" link "a:main.seg","fromsys" center b=(edit(3)/2)-(len(a$)/2):if b<1 b=1 print chr$(32,b); if flag(32) print chr$(15);a$;chr$(14):return print a$:return start print sc$ if flag(32) a$=chr$(32,16)+chr$(14,2):gosub center if flag(32) a$=" "+chr$(14)+" Voting Booth "+chr$(15)+" ":gosub center if flag(32) a$=chr$(32,16)+chr$(14,2):gosub center if not flag(32) a$="%> Voting Booth <%":gosub center start1 print' [#)_Booth name_______________|TV|NV|FL| [1) SysOp Votes |--|--|01|' open #2,"h:uv.data":input #2,x,a:close #2 open #1,"f:u."+str$(un):position #1,5,9:gosub sub print "[2) User Votes |"a$"|"i$"|01|" open #2,"h:nu.data":input #2,x,a:close #2 position #1,5,13:gosub sub print "[3) New User Access Requests |"a$"|"i$"|03|" open #2,"h:ae.data":input #2,x,a:close #2 position #1,5,6:gosub sub:close print "[4) AE Access Requests |"a$"|"i$"|20|" print \"Select: "; start2 clear key:gosub get.key:a=val(i$) if (not a) or (a<1) or (a>4) print "Quit...":goto link.main print i$;:if a=1 a$="h:v1":gosub voting:goto start1 if a=2 a$="h:uv":print sc$:goto user.vote if (a=4) and flag(20) a$="h:ae":link "a:newvote.seg" if (a=3) and flag(3) a$="h:nu":link "a:newvote.seg" print chr$(8);" ";chr$(8);chr$(7);:goto start2 sub input #1,gh a$=str$((a-x)+1):if len(a$)<2 a$="0"+a$ if (gha) gh=x-1 i$=str$(a-gh):if len(i$)<2 i$="0"+i$ return user.vote print ' Which would you like to do - [1) Vote [2) Post a Vote Select: '; clear key:gosub get.key:print i$;:a=val(i$) if (a<1) or (a>2) goto start1 if a=1 link "a:newvote.seg" print sc$\"Enter your vote question now - .s = save|.h = help|'done' to edit msg." edit(0):edit(1):if not edit(2) goto user.vote print \"One moment..."; fn$=a$+".data":open #1,fn$ input #1,a,z:z=z+1:if z>999 z=1 mark(1)=0:print #1,a,z:close a$=a$+str$(z):x=0 f$=a$+".user":open #1,f$:print #1,un:close f$=a$+".1":kill f$:create f$ i$=a$+"temp":create i$:print chr$(8,13);chr$(32,13);chr$(8,13) print 'Enter your vote answers: Hit on a blank line when done.' open #1,i$:print #1,"Vote From -%>"a4$; if nb$ print #1," ["nb$"]"; print #1," (#"un")" print #1,"Vote Date -%>"date$" "time$\ copy #8,#1:append #1:print #1,chr$(13) j1 x=x+1:print \"Answer #"x":" input @3 ">"o$:if not o$ close:x=x-1:goto v.end print #1,"["x") "o$:goto j1 v.end if x<1 close:goto dumb.user edit(0):copy i$,#8:open #1,f$:print #1,x copy #8,#1:close print \"%> Vote Created <%":kill i$:goto start dumb.user print \"%> Vote Aborted <%" open #1,fn$:input #1,a,z z=z-1:if z<1 z=1 mark(1)=0:print #1,a,z:close kill a$+".user":kill a$+".1":kill i$ goto start voting create a$:open #1,a$ mark(1)=(un/512)*64:x=mark(1):fill ram2,64,0 read #1,ram2,64:z=flag:flag=ram2:a=flag(un) flag(un)=1:flag=z:mark(1)=x:write #1,ram2,64 x=1:z=byte:byte=ram2 vote2 open #2,a$+"."+str$(x):if mark(2) goto vote5 input #2,y:if a then setint(1) print \\s$\:copy #2:position #1,32,x+7 fill ram2,32,0:read #1,ram2,32 b=byte(0)+byte(1)*256:if a goto vote4 vote3 print \"Vote (1-"y",S)kip):"; input i$:if i$="S" goto vote4 d=val(i$):if (d<1) or (d>y) goto vote3 b=b+1:byte(0)=b mod 256:byte(1)=b/256 c=byte(d*2)+byte(d*2+1)*256:c=c+1 byte(d*2)=c mod 256:byte(d*2+1)=c/256 position #1,32,x+7:write #1,ram2,32 vote4 if key(1) then close:return print \"Results from "b" users:"\:b=b+(b=0) for c=1 to y:y=byte(c*2)+byte(c*2+1)*256 print "Answer #"c" - "(y*100)/b"% ("y")" next:close #2:x=x+1:goto vote2 vote5 close:byte=z:return get.key ww=0:wx=0 get.key1 gf=clock(2) if (gf<>0) and (clock(1)>gf) print \\"[ Time Limit Exceeded ]":pop:goto no.car gf=peek(-16384):if (gf=129) or (gf=150) get i$:print chr$(8);:return gf=key(0):if (gf>96) and (gf<123) gf=gf-32 if (gf>31) or (gf=13) i$=chr$(gf):return ww=ww+1:if flag(33)=0 goto get.key2 wx=wx+1:if wx>16 wx=1 print mid$("!/-\!/-\!\-/!\-/",wx,1);chr$(8); get.key2 if ww=2000 print chr$(7,2); if ww=4000 pop:goto no.car if (not info(0)) and (not info(5)) and (eu<>1) pop:goto no.car goto get.key1