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 BBS Support/Help/Discussion  <--  <--- Return to Home Page
   Networked Database  BBS Support/Help/Discussion   [56 / 1491] RSS
 From   To   Subject   Date/Time 
Message   Bill McGarrity    Sean Dennis   Fixing the nodelist script   April 7, 2017
 10:35 PM *  

-=> Sean Dennis wrote to All on 04-07-17 20:26 <=-


 SD> I finally figured out what I was doing wrong with the Micronet
 SD> nodelist/infopack bash script.

 SD> So what I had to do was get the current day number of the current year:
 SD> DOY=$(date +%j)

 SD> Then, I had to get the last two digits of the day number:
 SD> DOY1=`echo "${DOY:(-2)}"`
 SD> (the backticks tell bash to run this as a command and store the output
 SD> in the variable)

 SD> Here's where I screwed up.  I didn't perform the correct arithmetic
 SD> (sp?) on the variable.  This is what I wound up doing to get the last
 SD> Friday's DOY: OLDDOY=`echo $((DOY1 - 8 ))`

 SD> Seems bash is like REXX in that no variable is typed and treated as a
 SD> string unless you tell it otherwise.

 SD> That seemed to have fixed the problem.

You think your's is tough... lool what I ahd to go through to get a sindoze
version to get the day ordinal #... :)

Spent a few sleepless nights on this one.. lol!!



@echo & setlocal enableextensions disabledelayedexpansion

set year=%date:~-4,4%

set day=%date:~-7,2% 
if "%day:~0,1%"=="0" set day=%day:~1%

set month=%date:~-10,2%
if "%month:~0,1%"=="0" set month=%month:~1%

echo Today's Date: %day%%month% %year% 

:: Call the day ordinal number subroutine
 
call :JDdayNumber %day%%month% %year% DayOrdinalNumber

:: Display the result

if DayOrdinalNumber LSS 100 set DayOrdinalNumber=0%DayOrdinalNumber% 


set zipday=z%DayOrdinalNumber:~-2,3%


echo "%day%%month% %year% Day ordinal number: 0%DayOrdinalNumber% (%zipday%)"



endlocal & goto :EOF
::
:: ============================================================
:: Subroutine: Calculate a day's ordinal number within the year

@echo

:JDdayNumber dm y return_
   setlocal enableextensions enabledelayedexpansion
   if %2 LEQ 2 (
     set /a a=%3-1
     set /a b=!a!/4-!a!/100+!a!/400
     set /a c=^(!a!-1^)/4-^(!a!-1^)/100+^(!a!-1^)/400
     set /a s=!b!-!c!
     set /a e=0
     set /a f=%1-1+31*^(%2-1^)
     ) else (
     set /a a=%3
     set /a b=!a!/4-!a!/100+!a!/400
     set /a c=^(!a!-1^)/4-^(!a!-1^)/100+^(!a!-1^)/400
     set /a s=!b!-!c!
     set /a e=!s!+1
     set /a f=%1+^(153*^(%2-3^)+2^)/5+58+!s!
     )
   set /a return_=!f!+1
   endlocal & set "%4=%return_%" & goto :EOF


--

Bill

Telnet: tequilamockingbirdonline.net
Web: bbs.tequilamockingbirdonline.net
FTP: ftp.tequilamockingbirdonline.net:2121
IRC: irc.tequilamockingbirdonline.net Ports: 6661-6670 SSL: +6697
Radio: radio.tequilamockingbirdonline.net:8010/live


... Look Twice... Save a Life!!! Motorcycles are Everywhere!!!
=== MultiMail/Win32 v0.50
--- SBBSecho 3.00-Win32
 * Origin: TequilaMockingbird Online - Badlands of NJ (618:100/24)
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to BBS Support/Help/Discussion  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.0147 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