Giter Site home page Giter Site logo

Comments (16)

checkdigits avatar checkdigits commented on June 5, 2024 2

I'll look again on Monday and see if I can get a copy of XE4 and I'll fix this.

In theory my MVP licenses allow me to download and install all versions but, ironically, a bug in the license server prevents me from activating the copy! (Not cool after a several GB download). Ironically I did have XE3 and XE4 installed until only a few weeks ago but I deleted them to save some space.

That internal error can be triggered by several things. I agree generics might well cause it a problem but there's a number of other things too which don't relate to the actual syntax in the source.

When I get XE4 installed again I'll fix the bits you mentioned @edwinyzh wrapping them so Rio and later works too and then submit a pull request. It'll be a few days before I can get to it.

This project is worth the effort - if it can be made to work for older compilers, that would be great. If it can't be done at least it will not be for want of us trying! 😃 👍

from delphiconsole.

checkdigits avatar checkdigits commented on June 5, 2024 1

Not sure about XE4 but it sounds like you're missing the include for system.UITypes (documented here: http://docwiki.embarcadero.com/Libraries/Rio/en/System.UITypes)

That unit defines the following for vkPeriod:

const vkPeriod: Integer = $BE;

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024 1

First of all thank you for your kind words. Like I've stated in the intro text the inspiration came from C#. After have made console applications in C# for a while I returned to Delphi and found out hvw low level console programming was in Delphi. So I decided to make this class. I simple "stole" the interface definition from C# and then started programming :D

About the issue:
It seems like vkPeriod has come into System.UITypes Later on. I don't have access to a Delphi XE 4 compiler so I can't test if any thing else is missing.

Would you please add this to your source code:
{$IF CompilerVersion < 23}
const
vkPeriod = $BE;
{$IFEND}

And tell me if that solves the problem. When we have it all sorted out I'll update the Repo.

from delphiconsole.

edwinyzh avatar edwinyzh commented on June 5, 2024 1

I think it's a very valid and good approach to port/borrow ideas from the c# world :D

I worked around the virtual key constants errors by adding the following:

// XE4's CompilerVersion is 25
{$IF CompilerVersion <= 25}
const
  vkPeriod = $BE;
  vkPara =  $DF;
  vkOem102 =  $E2;
{$IFEND}

But still encounter a compiler error that doesn't seem easy to be solved:
[dcc32 Fatal Error] System.Console.pas(1213): F2084 Internal Error: URW1154

Tried cleaning and rebuilding the project. Not sure what we can do here.

from delphiconsole.

checkdigits avatar checkdigits commented on June 5, 2024 1

Het @JensBorrisholt if you need some help with getting hold of XE4 for this please let me know. I am an Embarcadero MVP and we're currently looking to add a bunch of things to GetIt - this unit being one of them. There are some things I can make happen for you via Embarcadero if you're going to maintain this repo going forward.

I don't have XE4 loaded but I can install it over the weekend and fix some of the problems if it helps you or I can reach out to some fellow MVPs and see if any of them have a XE4 installed.

Would you be open to the idea of us including DelphiConsole as one of the packages available via the GetIt package manager? It doesn't affect you directly - myself and some of the engineers at Embarcadero actually produce and co-ordinate the listings (as well as other MVPs and OSS maintainers) and we keep a watch on updates too so we can keep GetIt up to date,

Let me know what I can do to help.

-Ian.
DelphiConsole is a great addition - good work!

from delphiconsole.

checkdigits avatar checkdigits commented on June 5, 2024 1

Ah - I should have checked GetIt first!

I'll see what I can do over the weekend. It's possible that it can't be fixed for some versions of Delphi XE but those errors look like they would be fixable so we shall see if I can sort it out.

from delphiconsole.

checkdigits avatar checkdigits commented on June 5, 2024 1

OK - quick update. I tried downloading XE4 but I couldn't get it to activate for various reasons.

So the following is guesswork...

XE4 was the version which introduced changes to the ENDIF/IFEND conditional directive. So I'm wondering if that might be the problem?

If you edit the code so that IFEND is instead ENDIF as shown below this might resolve the issue for XE4 and below.

// XE4's CompilerVersion is 25
{$IF CompilerVersion <= 25}
const
  vkPeriod = $BE;
  vkPara =  $DF;
  vkOem102 =  $E2;
{$ENDIF}

from delphiconsole.

edwinyzh avatar edwinyzh commented on June 5, 2024 1

@JensBorrisholt , tried again, I had to replace all occurrences of Int16.MaxValue.ToString into IntToStr(Int16.MaxValue), and the source seems to be valid on the syntax level, but then I got the following error which is the same mentioned days ago:
[dcc32 Fatal Error] System.Console.pas(1213): F2084 Internal Error: URW1154

That seems to be a compiler error which might related to the generics syntax, no idea how to solve it. Maybe @checkdigits can help :)

Update 1: PS: In the past I only met this 'Internal Error' issue (which couldn't be solved by restarting the IDE) only once with https://github.com/malcolmgroves/FluentQuery which intensively uses the generics feature.

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024 1

I have now fixed the internal Error. I've tested with Delphi 2010.

The problem where TValue.From ... It have now been replaced.

Please update your code

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024

I've updated the project. Please try again

from delphiconsole.

edwinyzh avatar edwinyzh commented on June 5, 2024

@JensBorrisholt , Thanks, now I got another bunch of errrors:
[dcc32 Error] System.Console.pas(92): E2026 Constant expression expected
[dcc32 Error] System.Console.pas(94): E2026 Constant expression expected
[dcc32 Error] System.Console.pas(94): E2026 Constant expression expected
[dcc32 Error] System.Console.pas(1080): E2018 Record, object or class type required
[dcc32 Error] System.Console.pas(1086): E2029 Declaration expected but 'IF' found
[dcc32 Error] System.Console.pas(1088): E2003 Undeclared identifier: 'BufferInfo'
[dcc32 Error] System.Console.pas(1088): E2029 'THEN' expected but identifier 'srWindow' found
[dcc32 Error] System.Console.pas(1089): E2018 Record, object or class type required
[dcc32 Error] System.Console.pas(1092): E2029 '.' expected but ';' found
[dcc32 Error] System.Console.pas(1104): E2004 Identifier redeclared: 'Finalization'
[dcc32 Error] System.Console.pas(1106): E2029 '(' expected but ':=' found
[dcc32 Error] System.Console.pas(1106): E2003 Undeclared identifier: 'ConsoleOutputHandle'
[dcc32 Error] System.Console.pas(1107): E2003 Undeclared identifier: 'Width'
[dcc32 Error] System.Console.pas(1107): E2003 Undeclared identifier: 'X'
[dcc32 Warning] System.Console.pas(1107): W1023 Comparing signed and unsigned types - widened both operands
[dcc32 Error] System.Console.pas(1108): E2029 ')' expected but identifier 'ToString' found
[dcc32 Error] System.Console.pas(1108): E2014 Statement expected, but expression of type 'string' found
[dcc32 Warning] System.Console.pas(1109): W1011 Text after final 'END.' - ignored by compiler
[dcc32 Error] System.Console.pas(179): E2065 Unsatisfied forward or external declaration: 'Console.WriteString'
[dcc32 Error] System.Console.pas(195): E2065 Unsatisfied forward or external declaration: 'Console.SetWindowTop'
[dcc32 Error] System.Console.pas(215): E2065 Unsatisfied forward or external declaration: 'Console.SetWindowWidth'
[dcc32 Error] System.Console.pas(258): E2065 Unsatisfied forward or external declaration: 'Console.UpdateConsoleFont'
[dcc32 Error] System.Console.pas(259): E2065 Unsatisfied forward or external declaration: 'Console.Write'
[dcc32 Error] System.Console.pas(260): E2065 Unsatisfied forward or external declaration: 'Console.Write'
[dcc32 Error] System.Console.pas(261): E2065 Unsatisfied forward or external declaration: 'Console.WriteLine'
[dcc32 Error] System.Console.pas(262): E2065 Unsatisfied forward or external declaration: 'Console.WriteLine'
[dcc32 Error] System.Console.pas(263): E2065 Unsatisfied forward or external declaration: 'Console.WriteLine'
[dcc32 Hint] System.Console.pas(179): H2219 Private symbol 'WriteString' declared but never used
[dcc32 Hint] System.Console.pas(180): H2219 Private symbol 'GenericToString' declared but never used
[dcc32 Hint] System.Console.pas(213): H2219 Private symbol 'SetBufferSize' declared but never used
[dcc32 Fatal Error] TestConsoleApp.dpr(8): F2063 Could not compile used unit 'System.Console.pas'

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024

I've removed the MS Build stuff from the project. Try again. It is extremely hard to debug since I do not have access to an XE 4 installation

from delphiconsole.

edwinyzh avatar edwinyzh commented on June 5, 2024

@JensBorrisholt , sorry, same error... But I can understand your situation. thanks for the help all the same!

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024

I'm trying to get a xe4 Delphi so I can fix the errors

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024

Ian if you can fix the problems with this unit and xe4 that would be great. I only have the community edition of Delphi.

This repo is all ready on Getit

from delphiconsole.

JensBorrisholt avatar JensBorrisholt commented on June 5, 2024

Tank you for your heads up Ian. I believe I've found the bug.

@edwinyzh please try again :D

from delphiconsole.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.