Robert,
Yes, I will be very glad to help. I will try to find the time either tonight or on the weekend (if this suits you).
Best regards,
Leonid
Problem with class VO.Console
Problem with class VO.Console
Best regards,
Leonid
Leonid
Problem with class VO.Console
Robert,
Updates in the attachment.
Best regards,
Leonid
Updates in the attachment.
Best regards,
Leonid
- Attachments
-
- VOConsoleClass_OnlyUpdatedMethods.zip
- (970 Bytes) Downloaded 36 times
Best regards,
Leonid
Leonid
Problem with class VO.Console
The code in the attachment implies that we do not know the values of the ConsoleColor enum and the numeric values of the attributes of the console text in win32. But if you make conditional assumptions, the code will be even simpler:
and nothing changes in the constructor.
Best regards,
Leonid
Code: Select all
PROPERTY TextAttribute AS WORD
GET
RETURN (WORD)System.Console.ForegroundColor | (WORD)(System.Console.BackgroundColor) << 4
END GET
SET
System.Console.ForegroundColor := (ConsoleColor) (WORD)(VALUE & 0x000F)
System.Console.BackgroundColor := (ConsoleColor) (WORD)((VALUE >> 4) & 0x000F)
END SET
END PROPERTY
Best regards,
Leonid
Best regards,
Leonid
Leonid
Problem with class VO.Console
Leonid,
I think I like this one better.
I'll also add the FOREGROUND_ and BACKGROUND_ defines to the Console classes so no reference to Win32 is needed anymore.
Robert
I think I like this one better.
I'll also add the FOREGROUND_ and BACKGROUND_ defines to the Console classes so no reference to Win32 is needed anymore.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu