Alpha 19 sync

This commit is contained in:
mysticbbs 2012-09-20 13:54:12 -04:00
parent 4ba62f0a5e
commit de3aeaf8f9
5 changed files with 27 additions and 21 deletions

View File

@ -292,25 +292,17 @@ End;
Function DayOfWeek (Date: LongInt) : Byte;
Var
Offset : Byte;
DT : DateTime;
DT : DateTime;
Res : LongInt;
Begin
UnpackTime (Date, DT);
If DT.Month > 2 Then Offset := 0 Else Offset := 1;
If DT.Month < 3 Then
Res := 365 * DT.Year + DT.Day + 31 * (DT.Month - 1) + Trunc ((DT.Year - 1) / 4) - Trunc(0.75 * Trunc((DT.Year - 1) / 100) + 1)
Else
Res := 365 * DT.Year + DT.Day + 31 * (DT.Month - 1) - Trunc (0.4 * DT.Month + 2.3) + Trunc (DT.Year / 4) - Trunc (0.75 * Trunc (DT.Year / 100) + 1);
Result := (((3 * (DT.Year) - (7 * ((DT.Year) + ((DT.Month) + 9) DIV 12))
DIV 4 + (23 * (DT.Month)) DIV 9 + (DT.Day) + 2 + (((DT.Year) -
Offset) DIV 100 + 1) * 3 DIV 4 - 16) MOD 7));
(*
IF m < 3 THEN
F := 365 * y + d + 31 * (m - 1) + trunc ((y - 1) / 4) -
trunc (0.75 * trunc ((y - 1) / 100) + 1)
ELSE
f := 365 * y + d + 31 * (m - 1) - trunc (0.4 * m + 2.3) +
trunc (y / 4) - trunc (0.75 * trunc (y / 100) + 1);
tot := f MOD 7;
*)
Result := Res MOD 7;
End;
Function DaysAgo (Date: LongInt) : LongInt;

View File

@ -154,7 +154,7 @@ Begin
FInBufEnd := 0;
FOutBufPos := 0;
FTelnetState := 0;
FTelnetEcho := False;
FTelnetEcho := True;
FTelnetClient := False;
FTelnetServer := False;
FDisconnect := True;
@ -395,7 +395,7 @@ Begin
End;
If Buf[Count] = Telnet_Echo Then
FTelnetEcho := True;
FTelnetEcho := False;
End;
End;
End;

View File

@ -5,8 +5,8 @@ Unit m_Pipe;
Interface
{$IFDEF UNIX}
Uses m_Pipe_Unix;
Type TPipe = Class(TPipeUnix);
Uses m_Pipe_Disk;
Type TPipe = Class(TPipeDisk);
{$ENDIF}
{$IFDEF WINDOWS}
@ -21,4 +21,4 @@ Interface
Implementation
End.
End.

View File

@ -352,7 +352,9 @@ Begin
Result := Str[1];
If Pos(' ', Str) > 0 Then
Result := Result + Str[Succ(Pos(' ', Str))];
Result := Result + Str[Succ(Pos(' ', Str))]
Else
Result := Result + Str[2];
End;
Function strWrap (Var Str1, Str2: String; WrapPos: Byte) : Byte;

View File

@ -91,10 +91,15 @@ Var
Y : Byte;
Begin
Y := ParseNumber;
If Y = 0 Then Y := 1;
X := ParseNumber;
If X = 0 Then X := 1;
Screen.CursorXY (X, Y);
ResetState;
End;
@ -201,10 +206,12 @@ Begin
'm' : Begin
If Length(Options) = 0 Then Begin
Screen.TextAttr := 7;
ResetState;
End Else
While Length(Options) > 0 Do Begin
Temp := ParseNumber;
Case Temp of
0 : Screen.TextAttr := 7;
1 : Screen.TextAttr := Screen.TextAttr OR $08;
@ -219,20 +226,24 @@ Begin
47: Screen.TextAttr := (Screen.TextAttr AND $F + ColorTable[Temp]);
End;
End;
ResetState;
End;
'n' : Begin
If Client <> NIL Then
Client.WriteStr(#27 + '[' + strI2S(Screen.CursorY) + ';' + strI2S(Screen.CursorX) + 'R');
ResetState;
End;
's' : Begin
SavedX := Screen.CursorX;
SavedY := Screen.CursorY;
ResetState;
End;
'u' : Begin
Screen.CursorXY (SavedX, SavedY);
ResetState;
End;
Else
@ -254,6 +265,7 @@ Begin
#12 : Screen.ClearScreen;
Else
Screen.WriteChar(Ch);
State := 0;
WasValid := True;
End;