AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages!

You are not logged in. Login here for full access privileges.

Previous Message | Next Message | Back to VBBS/VADV Script Discussion  <--  <--- Return to Home Page
   Networked Database  VBBS/VADV Script Discussion   [232 / 233] RSS
 From   To   Subject   Date/Time 
Message   Lorrim    jahmas   Script idea   June 20, 2020
 7:32 AM  

Re: Script idea

> If I could write a script, it would be a countdown until the November
> presidential election.

My board is down because of packing to move so I can't test the vscript part of
this but here is a quick and dirty way to pull it off. Vscript doesn't have a
way to calculate dates, but you can have an external program convert date x to
day-of-the-year format (sometimes called Julian or epoch) and do simple math on
it. I used REXX for this example and vscript to do the bbs output part of it.
You can replace the text with calls to display ANSI files or what have you to
pretty it up.

/* REXX script to do coundown calculation */

day = Date('Days';)

/* Write the output to a text file. Overwrite if it already exists */
rc = LINEOUT("C:\VADV\TXT\TIMER.TXT", day, 1)
IF rc \== 0 THEN DO
Error:
	SAY "ERROR:" STREAM("C:\VADV\TXT\TIMER.TXT", "D";)
	RETURN
END

RETURN


================================

'VADV Countdown Script'

'This is the target day of the year from 1-365. Nov. 3 2020 in this case'
let t0=308

'Open the file we created with the REXX script in output mode'
OPEN C:\VADV\TXT\TIMER.TXT, O
READ C:\VADV\TXT\TIMER.TXT d0

IFVAL t0 = d0 GOTO EDay

let x0 = t0-d0

IFVAL x0 > 0 GOTO CTimer

PRINT "The election is over. Did you vote?"
END

EDay:
PRINT "Today is election day. Be sure to vote!"
END

CTimer:
PRINT "It is " x0 " days until election day."
END


--
[AT2k] -- Your VBBS/VADV Support Center -- [www.at2k.org] -- [bbs.at2k.org]
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to VBBS/VADV Script Discussion  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.017 seconds

If you experience any problems with this website or need help, contact the webmaster.
VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved.
Virtual Advanced Copyright © 1995-1997 Roland De Graaf.
v2.1.241108