;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This presentation is the property of its rightful owner.
Sponsored Links
1 / 289

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PowerPoint PPT Presentation


  • 72 Views
  • Uploaded on
  • Presentation posted in: General

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;. ; Enhanced Bulletin Lister v1.1. ; Written by Drew [PWA]. ; Last updated 04-27-95. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;.

Download Presentation

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Enhanced bulletin lister v1 1

; Enhanced Bulletin Lister v1.1


Written by drew pwa

; Written by Drew [PWA]


Last updated 04 27 95

; Last updated 04-27-95


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Function procedure decl s

; function/procedure decl's


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Declare procedure initialize

declare procedure Initialize()


Declare function getbulllist string

declare function GetBullList() string


Declare function getmaxlength byte

declare function GetMaxLength() byte


Declare procedure getinput

declare procedure GetInput()


Declare procedure checkhotkey byte ascii var byte currow var byte curblt

declare procedure CheckHotKey(byte ascii, var byte currow, var byte curblt)


Declare procedure parseselected byte curblt

declare procedure ParseSelected(byte curblt)


Declare procedure printmenu

declare procedure PrintMenu()


Declare procedure printbulletin byte curblt

declare procedure PrintBulletin(byte curblt)


Declare procedure printcredits

declare procedure PrintCredits()


Declare procedure printhighlight byte currow

declare procedure PrintHighlight(byte currow)


Declare procedure restoretext byte currow

declare procedure RestoreText(byte currow)


Declare procedure getmanualinput string select

declare procedure GetManualInput(string select)


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Global var s

; global var's.


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


String bltlstfile the blt lst file

string bltlstfile ; the BLT.LST file


String bltmenu the blt menu

string bltmenu ; the BLT menu


String lb colour colour of lightbar

string lb_colour ; colour of lightbar


String save text used to save and restore highlighted text

string save_text ; used to save and restore highlighted text


Byte numblt number of bulletins

byte numblt ; number of bulletins


Byte startrow starting row for lightbar

byte startrow ; starting row for lightbar


Byte startcol starting column for lightbar

byte startcol ; starting column for lightbar


Byte numskiprow number of rows to skip per lightbar movement

byte numskiprow ; number of rows to skip per lightbar movement


Byte lb length lightbar length

byte lb_length ; lightbar length


Boolean autopause pause after displaying every bulletin

boolean autopause ; pause after displaying every bulletin


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


5036918

; main


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Begin

begin


Initialize

Initialize()


Printmenu

PrintMenu()


Getinput

GetInput()


5036918

end


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Gets input from user moves lightbar etc

; gets input from user, moves lightbar, etc.


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure getinput

procedure GetInput()


Boolean done

boolean done


Byte curblt

byte curblt


Byte ascii

byte ascii


Byte currow

byte currow


Ansipos startcol startrow

ansipos startcol, startrow


Currow startrow

currow = startrow


Printhighlight currow

PrintHighlight(currow)


Curblt 1

curblt = 1


Done false

done = FALSE


While done do

while (!done) do


Ascii asc inkey

ascii = asc(inkey())


Delay 1

delay 1


Select case ascii

select case (ascii)


Case 13

case 13


Carriage return print the bulletin and remain in the ppe

; carriage return - print the bulletin, and remain in the ppe


5036918

;


Printbulletin curblt

PrintBulletin(curblt)


Printmenu1

PrintMenu()


Printhighlight currow1

PrintHighlight(currow)


Case 76 85 56

case 76, 85, 56


Left arrow up arrow 8

; left arrow, up arrow, 8


Restoretext currow

RestoreText(currow)


Dec curblt

dec curblt


If curblt 1 curblt numblt

if (curblt < 1) curblt = numblt


Currow currow numskiprow

currow = currow - numskiprow


If currow startrow currow startrow numblt 1 numskiprow

if (currow < startrow) currow= startrow + ((numblt-1) * numskiprow)


This is the fix

; ^^^ this is the fix


From v1 0

; from v1.0


Printhighlight currow2

PrintHighlight(currow)


Case 82 68 50

case 82, 68, 50


Right arrow down arrow 2

; right arrow, down arrow, 2


Restoretext currow1

RestoreText(currow)


Inc curblt

inc curblt


If curblt numblt curblt 1

if (curblt > numblt) curblt = 1


Currow currow numskiprow1

currow = currow + numskiprow


If currow startrow numblt numskiprow 1 currow startrow

if (currow > startrow + (numblt * numskiprow) - 1) currow= startrow


Printhighlight currow3

PrintHighlight(currow)


Case 69

case 69


5036918

; "end"


Restoretext currow2

RestoreText(currow)


Curblt numblt

curblt = numblt


Currow startrow numblt 1 numskiprow

currow = startrow + ((numblt-1) * numskiprow)


Printhighlight currow4

PrintHighlight(currow)


Case 72

case 72


5036918

; "home"


Restoretext currow3

RestoreText(currow)


Curblt 11

curblt = 1


Currow startrow1

currow = startrow


Printhighlight currow5

PrintHighlight(currow)


Case 27 81 113

case 27, 81, 113


Esc q q quit

; ESC, Q, q - quit


Done true

done = TRUE


Default

default


Make sure the parameter is the ascii of the lower case letter

; make sure the parameter is the ascii # of the lower case letter.


Variables done and curblt cat get updated here

; variables "done" and "curblt" cat get updated here.


5036918

;


Checkhotkey asc lower chr ascii 96 currow curblt

CheckHotKey(asc(lower(chr(ascii))) - 96, currow, curblt)


Endselect

endselect


Endwhile

endwhile


Printcredits

PrintCredits()


Endproc

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Check if the user hit a hotkey corresponding to the bulletin if so then

; check if the user hit a hotkey corresponding to the bulletin. if so, then


Print the bulletin and remain in the ppe

; print the bulletin and remain in the ppe


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure checkhotkey byte ascii var byte currow var byte curblt

procedure CheckHotKey(byte ascii, var byte currow, var byte curblt)


If ascii 1 ascii numblt then

if ((ascii >= 1) && (ascii <= numblt)) then


Restoretext currow4

RestoreText(currow)


Currow currow ascii curblt numskiprow

currow = currow + ((ascii - curblt) * numskiprow)


Printhighlight currow6

PrintHighlight(currow)


Curblt ascii

curblt = ascii


Printbulletin curblt1

PrintBulletin(curblt)


Printmenu2

PrintMenu()


Printhighlight currow7

PrintHighlight(currow)


Endif

endif


Endproc1

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


I hope no one minds

; i hope no one minds. :)


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure printcredits

procedure PrintCredits()


Ansipos 1 u pagelen

ansipos 1, u_pagelen


Defcolor

defcolor


Println @x08enhanced bulletin lister v1 1 by drew pwa @x07

println "@X08Enhanced Bulletin Lister v1.1 by Drew [PWA]@X07"


Endproc2

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Save the old text and then print the lightbar

; save the old text and then print the lightbar


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure printhighlight byte currow

procedure PrintHighlight(byte currow)


Save text scrtext startcol currow lb length true

save_text = scrtext(startcol, currow, lb_length, TRUE)


Ansipos startcol currow

ansipos startcol, currow


Print lb colour stripatx save text

print lb_colour + stripatx(save_text)


Endproc3

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Restore text after moving lightbar

; restore text (after moving lightbar)


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure restoretext byte currow

procedure RestoreText(byte currow)


Ansipos startcol currow1

ansipos startcol, currow


Print save text

print save_text


Endproc4

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Print the blt file

; print the BLT file


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure printmenu

procedure PrintMenu()


Make sure we clear the screen

; make sure we clear the screen


5036918

cls


Dispfile bltmenu defs

dispfile bltmenu, DEFS


Endproc5

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Print the bulletin reads from blt lst automatically

; print the bulletin. reads from BLT.LST automatically. :)


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure printbulletin byte curblt

procedure PrintBulletin(byte curblt)


String foo

string foo


Get the full pathname of the bulletin

; get the full pathname of the bulletin


5036918

;


Fopen 1 bltlstfile o rd s dw

fopen 1, bltlstfile, O_RD, S_DW


Fseek 1 curblt 1 30 seek set

fseek 1, (curblt-1) * 30, seek_set


Fread 1 foo 30

fread 1, foo, 30


Fclose 1

fclose 1


Show the darn bulletin trimming any trailing spaces

; show the darn bulletin, trimming any trailing spaces


5036918

;


Ansipos 1 u pagelen1

ansipos 1, u_pagelen


Dispfile rtrim foo defs

dispfile rtrim(foo, " "), DEFS


If autopause wait

if (autopause) wait


Endproc6

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Does a whole bunch of initializing see inline documentation for more

; does a whole bunch of initializing. see inline documentation for more


Details should be straight forward

; details (should be straight forward).


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure initialize

procedure Initialize()


Byte numtok i confnum

byte numtok, i, confnum


String cnames

string cnames


String ebl cfg

string ebl_cfg


String foo foo2

string foo, foo2


String select

string select


Boolean found

boolean found


Wrunet pcbnode q un name un city ebl viewing bulletins

wrunet pcbnode(), "Q", un_name(), un_city(), "EBL: Viewing bulletins", " "


If the user does something like b 1 then kbdstuff accordingly

; if the user does something like "b 1", then kbdstuff accordingly


5036918

;


Numtok tokcount

numtok = tokcount()


If numtok then

if (numtok) then


Foo b

foo = "B "


For i 1 to numtok

for i = 1 to numtok


Foo foo gettoken

foo = foo + " " + gettoken()


Next i

next i


Kbdstuff foo

kbdstuff foo


5036918

end


Endif1

endif


Get the cnames file

; get the CNAMES file


5036918

;


Cnames readline pcbdat 31

cnames = readline(pcbdat(), 31)


If exist cnames then

if (!exist(cnames)) then


Println cnames does not exist bad path in pcboard dat

println cnames + " does not exist. Bad path in PCBOARD.DAT"


5036918

end


Endif2

endif


Get the blt menu file uses the cnames file

; get the BLT menu file (uses the CNAMES file)


5036918

;


Bltmenu readline cnames curconf 33 24

bltmenu = readline(cnames, (curconf() * 33) + 24)


We might want to do something if the menu doesn t exist

; we might want to do something if the menu doesn't exist...


If exist bltmenu then

; if (!exist(bltmenu)) then


Println @x0cwarning bulletin menu does not exist @x07

; println "@X0CWarning! Bulletin menu does not [email protected]"


Endif3

; endif


Get the full blt lst pathname uses the cnames file

; get the full BLT.LST pathname (uses the CNAMES file)


5036918

;


Bltlstfile readline cnames curconf 33 25

bltlstfile = readline(cnames, (curconf() * 33) + 25)


If exist bltlstfile then

if (!exist(bltlstfile)) then


No bulletins so stuffing b alone should automatically make

; no bulletins, so stuffing "B" alone should automatically make


Pcboard display the no bulletins message

; pcboard display the "no bulletins" message


5036918

;


Kbdstuff b

kbdstuff "B"


5036918

end


Endif4

endif


Calculate number of bulletins

; calculate number of bulletins


5036918

;


Numblt fileinf bltlstfile 4 30

numblt = fileinf(bltlstfile, 4) / 30


Check our config file

; check our config file


5036918

;


Ebl cfg ppepath ebl cfg

ebl_cfg = ppepath() + "EBL.CFG"


If exist ebl cfg then

if (!exist(ebl_cfg)) then


Println @x0cerror ebl cfg does not exist @x07

println "@X0CError! " + ebl_cfg + " does not [email protected]"


5036918

end


Endif5

endif


The first line is used if there is no line in the config file that

; the first line is used if there is no line in the config file that


Corresponds with the current conference

; corresponds with the current conference.


5036918

;


Fopen 1 ebl cfg o rd s dw

fopen 1, ebl_cfg, O_RD, S_DW


Fdefin 1

fdefin 1


Fdget foo

fdget foo


If lower foo yes then

if (lower(foo) == "yes") then


Autopause true

autopause = TRUE


5036918

else


Autopause false

autopause = FALSE


Endif6

endif


Fdget select

fdget select


Otherwise get a line see if the first token corresponds to the

; otherwise, get a line, see if the first token corresponds to the


Current conference

; current conference.


5036918

;


Fdget foo1

fdget foo


Found false

found = FALSE


While foo eof do

while (foo != "<eof>") do


Tokenize foo

tokenize foo


Foo2 gettoken

foo2 = gettoken()


If lower foo2 main curconf 0 then

if ((lower(foo2) == "main") && (curconf() == 0)) then


Found true

found = TRUE


Break

break


5036918

else


Confnum s2i foo2 10

confnum = s2i(foo2, 10)


If curconf 0 confnum curconf then

if ((curconf() != 0) && (confnum == curconf())) then


Found true1

found = TRUE


Break1

break


5036918

else


Fdget foo2

fdget foo


Endif7

endif


Endif8

endif


Endwhile1

endwhile


Fclose 11

fclose 1


First token matches current conf so parse the rest of the line to

; first token matches current conf, so parse the rest of the line to


Get the necessary information

; get the necessary information.


5036918

;


If found then

if (found) then


Startrow s2i gettoken 10

startrow = s2i(gettoken(), 10)


Startcol s2i gettoken 10

startcol = s2i(gettoken(), 10)


Numskiprow s2i gettoken 10

numskiprow = s2i(gettoken(), 10)


Lb length s2i gettoken 10

lb_length = s2i(gettoken(), 10)


Lb colour gettoken

lb_colour = gettoken()


5036918

else


If none of the lines has the first token matching the current conf

; if none of the lines has the first token matching the current conf,


Then we prompt them the old fashioned way

; then we prompt them the old fashioned way.


5036918

;


Getmanualinput select

GetManualInput(select)


Endif9

endif


Getuser

getuser


Endproc7

endproc


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Get which bulletin to view the old fashioned way

; get which bulletin to view the old fashioned way.


5036918

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Procedure getmanualinput string select

procedure GetManualInput(string select)


String text

string text


Newline

newline


Inputstr select text @x07 3 mask num chr 13 auto newline

inputstr select, text, @X07, 3, MASK_NUM() + CHR(13), AUTO + NEWLINE


If text then

if (text != "") then


Kbdstuff b text

kbdstuff "B " + text


Endif10

endif


5036918

end


Endproc8

endproc


  • Login