Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with "MOD"
#3
Thanks, that's how it works. Here's just a start:

Code: (Select All)

'Berechnung des Wochentages nach Julianischer/Gregeorianischer Formal
'https://de.wikipedia.org/wiki/Wochentagsberechnung
'5. Jan. 2025

Option _Explicit

Dim As Integer a, d, m, y, c, w
Dim As String wtag

'Welcher Wochentag war der 12. Juni 2006

d = 12
m = 4
y = 6
c = 20

'Formel nach gregorianischer Berechnung
a = (12 + (((2.6 * 4) - 0.2) + 6) + ((6 / 4) - 1) + (20 / 4) - (2 * 20))
w = (a Mod 7 + 7) Mod 7

Print Using "##"; w
'Print (-6 Mod 7 + 7) Mod 7; Hinweis: McNeill

Select Case w
  Case 1
    wtag = "Montag"
End Select

Print
Print "Der 12. Juni 2006 war ein ", wtag

End
Reply


Messages In This Thread
Problem with "MOD" - by Kernelpanic - 01-05-2025, 09:30 PM
RE: Problem with "MOD" - by SMcNeill - 01-05-2025, 09:57 PM
RE: Problem with "MOD" - by Kernelpanic - 01-05-2025, 10:39 PM
RE: Problem with "MOD" - by Pete - 01-06-2025, 02:01 AM
RE: Problem with "MOD" - by SMcNeill - 01-06-2025, 02:22 AM
RE: Problem with "MOD" - by Pete - 01-06-2025, 02:37 AM



Users browsing this thread: 2 Guest(s)