Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #179811

Re: {rightclick} New | Text Document

From Herbert Kleebauer <klee@unibwm.de>
Newsgroups alt.comp.os.windows-10
Subject Re: {rightclick} New | Text Document
Date 2024-11-09 16:38 +0100
Organization A noiseless patient Spider
Message-ID <vgnvlj$3rhe7$4@dont-email.me> (permalink)
References (1 earlier) <vgk1be$cmdj$1@news.samoylyk.net> <vgkgt0$34b07$1@dont-email.me> <vgl6cs$1kf7$1@news.samoylyk.net> <vgltr1$3brmr$1@dont-email.me> <vgmnip$5uia$1@news.samoylyk.net>

Show all headers | View raw


On 09.11.2024 05:14, Wolf Greenblatt wrote:
> On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:



> Many of my programs are those you wrote that I found on the archives for
> this newsgroup whenever I search for things - like your spelling program.

Maybe this calendar program is also useful. Depending on your
date format you have to modify the 3 lines below. And you
have to insert the birthdays of your friend at the end of the
batch.


@echo off
:: MODE doesn't work in Win11
:: MODE CON: COLS=40 LINES=40
setlocal

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: usage:
:: kalender.bat          show current month
:: kalender.bat  9       show month september of current year
:: kalender.bat  4 2007  show month april of year 2007
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: the format of the %date% variable must be in the following format:
:: set date=28.02.2001
:: if not, change the next three lines
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set /a y=%date:~6,4%
set /a m=1%date:~3,2%-100
set /a d=1%date:~0,2%-100
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: test for parameter month
if  not [%1]==[] set /a m=%1
if %m% lss 1 goto :eof
if %m% gtr 12 goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: test for parameter year
if  not [%2]==[] set /a y=%2
if %y% lss 1901 goto :eof
if %y% gtr 2100 goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: calculate the string for the week numbers
setlocal
(set t= )
for /l %%i in (1,7,29) do (
  set d=%%i
  call :date2week
  call set v= %%v%%
  call set v=%%v:~-2%%
  call set t=%%t%%%%v%%:                         )
endlocal & (set t=%t%    )
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: calculate the name of the first day of month %m% 0:monday 7:sunday
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
call  :date2day
set /a w=(w-d+2)%%7

set m[1]=Januar & set m[2]=Februar & set m[3]=Maerz & set m[4]=April
set m[5]=Mai & set m[6]=Juni & set m[7]=Juli & set m[8]=August
set m[9]=September&set m[10]=Oktober&set m[11]=November&set m[12]=Dezember

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: calculate the number of days in the month %m%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set /a n=28+(62648012^>^>(2*%m%)^&3)+ (!(%y% %% 4))*(!(%m%-2))


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: calculate the string for the days
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(set s= )
for /l %%i in (1,1,%w%) do (call set s=    %%s%%)
for /l %%i in (1,1,9) do if %%i EQU %d% (
            call set s=%%s%%[ %%i]) else (call set s=%%s%%  %%i )
for /l %%i in (10,1,%n%) do if %%i EQU %d% (
            call set s=%%s%%[%%i]) else (call set s=%%s%% %%i )

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: output the calendar
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo.&echo.
call echo            %%m[%m%]%% %y%
echo      Mo  Di  Mi  Do  Fr  Sa  So
for /l %%i in (1,28,141) do (call echo.%%t:~%%i,4%%%%s:~%%i,28%%)
echo.


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: output public holidays and bithdays
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set /a month=m
if %m% lss 10 set month=0%m%
set /a m=3
set /a d=1
call :date2day
call :ostern
set /a o=w+o-1

set i=.
for /f "tokens=2,3* delims=. " %%i in ('find "::%i%"^<"%~f0"') do (
  set /a d=%%i
  set /a m=%%j
  set  name=%%k
  call :sub)
pause
goto :eof


:sub
if not %m%==0 if %d%==0 echo.&goto :eof
if %m% lss 10 set m=0%m%
if %d% lss 10 set d=0%d%
if [%m%]==[%month%] echo  %d%.%m%.%y%  %name%
if not [%m%]==[00] goto :eof
set /a w=o+%d%
call :day2date
if %m% lss 10 set m=0%m%
if %d% lss 10 set d=0%d%
if [%m%]==[%month%] echo  %d%.%m%.%y%  %name%
goto :eof



:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: calculate the date of eastern in the year %y%               ::
:: 1: 1. march   31: 31. march   32: 1. april    ...           ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:ostern
set /a i=((y%%19)*19+15+((y/100)*3+3)/4-((y/100)*8+13)/25)%%30
set /a j=21+i-(i/29+(i/28-i/29)*((y%%19)/11))
set /a o=j+7-(j-(7-(y+y/4+2-((y/100)*3+3)/4)%%7))%%7
goto :eof

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: convert the date in %y% %m% %d% to the number of days (%w%) ::
:: since 1901  (day 0 is 1. Jan. 1901)                         ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:date2day
set /a w=(y-1901)*365+(y-1901)/4+d-1+(!(y %% 4))*(!((m-3)^&16))
set /a w=w+(m-1)*30+2*(!((m-7)^&16))-1+((65611044^>^>(2*m))^&3)
goto :eof

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: convert the number of days in %w% to the date (%y% %m% %d%) ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:day2date
set /a x=w/1461
set /a w=w-x*1461
set /a z=w/365-((w/365)^>^>2)
set /a w=w-z*365
set /a y=1901+x*4+z
set /a v=w-!(y%%4)
set /a m=!!(w/31)+!!(v/59)+!!(v/90)+!!(v/120)+!!(v/151)+!!(v/181)
set /a m=m+!!(v/212)+!!(v/243)+!!(v/273)+!!(v/304)+!!(v/334)+1
set /a d=w+1-(!(y%%4))*(!((m-3)^&16))
set /a d=d-((m-1)*30+2*(!((m-7)^&16))-1+((65611044^>^>(2*m))^&3))
goto :eof

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: calculate the week number %v% for the date (%y% %m% %d%)    ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:date2week
setlocal
call :date2day
set i=%w%
set d=1
set m=1
call :date2day
set /a n=(w+1)%%7
set /a v=!(n/4)
set /a v=v+(i-w+n)/7

if %v% gtr 0 goto :d2w1
set v=53
if %n%==4 goto :d2w2
set /a y=y-1
call :date2day
set /a n=(w+1)%%7
if %n%==3 goto :d2w2
set v=52
goto :d2w2

:d2w1
if %v% leq 52 goto :d2w2
if %n%==3 goto :d2w2
set /a y=y+1
call :date2day
set /a n=(w+1)%%7
if %n%==4 goto :d2w2
set v=1

:d2w2
endlocal & set v=%v%
goto :eof

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: insert holidays and birthdays here                          ::
:: format: ::. day.month.  description                         ::
:: if month==0 then day is the offset to eastern               ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::.  1.1.   Neujahr
::.  6.1.   Hl. 3 Koenige
::. 14.2.   Valentinstag
::.-48.0.   Rosenmontag
::.-47.0.   Faschingsdienstag
::. -2.0.   Karfreitag
::. -1.0.   Karsamstag
::.  0.0.   Ostersonntag
::.  1.0.   Ostermontag
::.  1.5.   Maifeiertag
::. 39.0.   Christi Himmelfahrt
::. 49.0.   Pfingstsonntag
::. 50.0.   Pfingstmontag
::. 60.0.   Fronleichnam
::. 15.8.   Maria Himmelfahrt
::.  3.10.  Tag d. dt. Einheit
::.  1.11.  Allerheiligen
::. 24.12.  Heiligabend
::. 25.12.  1. Weihnachtstag
::. 26.12.  2. Weihnachtstag
::. 31.12.  Silvester

::.  0.1.  just an empty line

::.  3.1. Emilia
::.  16.1. Noah
::.  22.1. Emma
::.  27.1. Leon
::.  12.2. Mia
::.  22.2. Liam
::.  22.2. Lina
::.  10.3. Leo
::.  16.3. Ella
::.  19.3. Milan
::.  20.3. Mila
::.  22.4. Emil
::.  27.4. Malia
::.  27.4. Felix
::.  2.5. Leni
::.  10.5. Luca
::.  19.5. Amelie
::.  8.6. Theo
::.  12.6. Leonie
::.  28.6. Matteo
::.  6.7. Luna
::.  15.7. Paul
::.  18.7. Hannah
::.  29.7. Emilio
::.  14.8. Sophie
::.  23.8. Henry
::.  3.9. Amalia
::.  12.9. David
::.  10.10. Sophia
::.  2.11. Jonas
::.  27.11. Charlotte
::.  11.12. Oskar
::.  11.12. Hanna
::.  24.12. Maximilian
::.  30.12. Lena

::.  0.1.  just an empty line
   


Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

{rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-10-15 08:47 -0400
  Re: {rightclick} New | Text Document Big Al <alan@invalid.com> - 2024-10-15 09:53 -0400
  Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-10-15 16:43 +0200
    Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-10-15 13:04 -0400
      Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-10-16 00:44 +0200
        Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-10-16 01:49 +0200
          Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-10-15 23:12 -0400
            Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-10-16 09:44 +0200
              Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-10-16 16:31 -0400
            Re: {rightclick} New | Text Document Newyana2 <newyana@invalid.nospam> - 2024-10-16 08:52 -0400
  Re: {rightclick} New | Text Document Newyana2 <newyana@invalid.nospam> - 2024-10-15 11:26 -0400
  Re: {rightclick} New | Text Document Paul <nospam@needed.invalid> - 2024-10-15 13:38 -0400
  Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-07 22:42 -0500
    Re: {rightclick} New | Text Document "R.Wieser" <address@is.invalid> - 2024-11-08 09:07 +0100
      Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-08 09:14 -0500
        Re: {rightclick} New | Text Document "R.Wieser" <address@is.invalid> - 2024-11-08 17:18 +0100
          Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-08 13:58 -0500
            Re: {rightclick} New | Text Document "R.Wieser" <address@is.invalid> - 2024-11-08 22:18 +0100
              Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-08 20:24 -0500
                Re: {rightclick} New | Text Document "R.Wieser" <address@is.invalid> - 2024-11-09 10:22 +0100
        Re: {rightclick} New | Text Document "R.Wieser" <address@is.invalid> - 2024-11-08 17:30 +0100
        Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-11-08 21:53 +0100
          Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-08 23:14 -0500
            Re: {rightclick} New | Text Document Zaidy036 <Zaidy036@air.isp.spam> - 2024-11-09 10:20 -0500
              Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-25 17:50 -0500
            Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-11-09 16:35 +0100
            Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-11-09 16:36 +0100
            Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-11-09 16:37 +0100
            Re: {rightclick} New | Text Document Herbert Kleebauer <klee@unibwm.de> - 2024-11-09 16:38 +0100
            Re: {rightclick} New | Text Document Wolf Greenblatt <wolf@greenblatt.net> - 2024-11-25 18:04 -0500

csiph-web