GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — smallbasic.github.io/samples/node/1385.bas at master · smallbasic/smallbasic.github.io

Expand file tree

/

1385.bas

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
57 lines (53 loc) · 1.87 KB
/

1385.bas

Copy path

File metadata and controls

57 lines (53 loc) · 1.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'screen labels tests.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-01-25
'originally inspired to help Johnno write a shuffleboard game
'hope to be very reusable, well not much use in Johnno's
'test code for reusable sub printlabel(text,lineNum,alignment)
'alignment =Left, Right, Middle,l,m,r, L, M, or R in quotes!?
? Int(ymax/txth("By"));" lines avaiable to your screen, probably start scrolling one or two before that"
input "Enter to continue...";dummy
cls
s="My test string"
'goto skip
printlabel(s,1,"lr")
printlabel(s,1,"r")
printlabel(s,1,"mr")
for i=1 to 10
printlabel(s,(int(rnd*30))+2,"r")
printlabel(s,(int(rnd*30))+2,"m")
printlabel(s,(int(rnd*30))+2,"l")
next
label Skip
for i=1 to Int(ymax/txth("By")) 'this will scroll unless sub is fixed, fixed!
printlabel s+" "+str(i),i,"m"
next
'a couple of beepers
'printlabel(s,100,r) 'this better beep!
printlabel("beep",35,"r") 'fix one beeper
pause
sub printlabel(labelstring, linenum, alignment)
'linenum assumes all labels have same height
'alignment choice of L,M,R or left, middle, right we will be looking at case insensitive first letter
'if nothing gets printed linenum is too big or alignment not spec'd correctly or showpage was not used in maine
'2016-01-26 fix max lineNum - 2 lines! to keep screen from scrolling after a print
local LMR,th,margin,tw,y
LMR=upper(left(alignment,1))
th=int(txth(labelstring))
' see how everything turns blue code Library has trouble with the less than symbol insert that sign and code in comment
' if you copied code from library ----V (less than) int(ymax-2*th) then
if instr("LMR",LMR) and linenum*th< int(ymax-2*th) then
margin=10
tw=txtw(labelstring)
y=margin+(lineNum-1)*th
select case LMR
case "L"
AT margin,y
case "M"
AT (xmax-tw)/2,y
case "R"
AT xmax-tw-margin,y
end select
print labelstring
else
beep
end if
end
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.