Delphi RAD Studio class completion issue












0















I can't invoke class completion (via Ctrl + Shift + C) using Embarcadero RAD Studio XE6, if I have following class structure. Program works fine, but the IDE causes the following error. If I want to use it, I must comment DescriptionArray, which is somewhat annoying.



Therefore I would like to know, if anyone knows, where is the problem, or what I'm doing wrong.



GT_Class = class
type
TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
TCustomSet = set of TCustomEnum;

const
DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
end;


Error Message



Error message










share|improve this question

























  • I think it is because there is nothing to complete in your class in the first place.

    – R. Beiboer
    Sep 6 '16 at 11:23






  • 4





    I can reproduce the error in XE6 but not in Berlin. Putting a visibility infront of the const though removed the error when invoking class completion.

    – Stefan Glienke
    Sep 6 '16 at 11:26











  • What do you expect to happen when you invoke class completion for this class?

    – R. Beiboer
    Sep 6 '16 at 11:40











  • This code snippet works just fine for me in Seattle. Looks like a bug in the IDE that has since been resolved.

    – Johan
    Sep 6 '16 at 11:43






  • 2





    @StefanGlienke: Found it: "If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public". So indeed, if inherited from TObject, it is public. If inherited from TPersistent (which is compiled with $M+), it is published.

    – Rudy Velthuis
    Sep 6 '16 at 15:44
















0















I can't invoke class completion (via Ctrl + Shift + C) using Embarcadero RAD Studio XE6, if I have following class structure. Program works fine, but the IDE causes the following error. If I want to use it, I must comment DescriptionArray, which is somewhat annoying.



Therefore I would like to know, if anyone knows, where is the problem, or what I'm doing wrong.



GT_Class = class
type
TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
TCustomSet = set of TCustomEnum;

const
DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
end;


Error Message



Error message










share|improve this question

























  • I think it is because there is nothing to complete in your class in the first place.

    – R. Beiboer
    Sep 6 '16 at 11:23






  • 4





    I can reproduce the error in XE6 but not in Berlin. Putting a visibility infront of the const though removed the error when invoking class completion.

    – Stefan Glienke
    Sep 6 '16 at 11:26











  • What do you expect to happen when you invoke class completion for this class?

    – R. Beiboer
    Sep 6 '16 at 11:40











  • This code snippet works just fine for me in Seattle. Looks like a bug in the IDE that has since been resolved.

    – Johan
    Sep 6 '16 at 11:43






  • 2





    @StefanGlienke: Found it: "If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public". So indeed, if inherited from TObject, it is public. If inherited from TPersistent (which is compiled with $M+), it is published.

    – Rudy Velthuis
    Sep 6 '16 at 15:44














0












0








0








I can't invoke class completion (via Ctrl + Shift + C) using Embarcadero RAD Studio XE6, if I have following class structure. Program works fine, but the IDE causes the following error. If I want to use it, I must comment DescriptionArray, which is somewhat annoying.



Therefore I would like to know, if anyone knows, where is the problem, or what I'm doing wrong.



GT_Class = class
type
TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
TCustomSet = set of TCustomEnum;

const
DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
end;


Error Message



Error message










share|improve this question
















I can't invoke class completion (via Ctrl + Shift + C) using Embarcadero RAD Studio XE6, if I have following class structure. Program works fine, but the IDE causes the following error. If I want to use it, I must comment DescriptionArray, which is somewhat annoying.



Therefore I would like to know, if anyone knows, where is the problem, or what I'm doing wrong.



GT_Class = class
type
TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
TCustomSet = set of TCustomEnum;

const
DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
end;


Error Message



Error message







delphi delphi-xe6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 6 '16 at 11:35









Johan

60.1k19145256




60.1k19145256










asked Sep 6 '16 at 10:51









TriberTriber

8471026




8471026













  • I think it is because there is nothing to complete in your class in the first place.

    – R. Beiboer
    Sep 6 '16 at 11:23






  • 4





    I can reproduce the error in XE6 but not in Berlin. Putting a visibility infront of the const though removed the error when invoking class completion.

    – Stefan Glienke
    Sep 6 '16 at 11:26











  • What do you expect to happen when you invoke class completion for this class?

    – R. Beiboer
    Sep 6 '16 at 11:40











  • This code snippet works just fine for me in Seattle. Looks like a bug in the IDE that has since been resolved.

    – Johan
    Sep 6 '16 at 11:43






  • 2





    @StefanGlienke: Found it: "If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public". So indeed, if inherited from TObject, it is public. If inherited from TPersistent (which is compiled with $M+), it is published.

    – Rudy Velthuis
    Sep 6 '16 at 15:44



















  • I think it is because there is nothing to complete in your class in the first place.

    – R. Beiboer
    Sep 6 '16 at 11:23






  • 4





    I can reproduce the error in XE6 but not in Berlin. Putting a visibility infront of the const though removed the error when invoking class completion.

    – Stefan Glienke
    Sep 6 '16 at 11:26











  • What do you expect to happen when you invoke class completion for this class?

    – R. Beiboer
    Sep 6 '16 at 11:40











  • This code snippet works just fine for me in Seattle. Looks like a bug in the IDE that has since been resolved.

    – Johan
    Sep 6 '16 at 11:43






  • 2





    @StefanGlienke: Found it: "If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public". So indeed, if inherited from TObject, it is public. If inherited from TPersistent (which is compiled with $M+), it is published.

    – Rudy Velthuis
    Sep 6 '16 at 15:44

















I think it is because there is nothing to complete in your class in the first place.

– R. Beiboer
Sep 6 '16 at 11:23





I think it is because there is nothing to complete in your class in the first place.

– R. Beiboer
Sep 6 '16 at 11:23




4




4





I can reproduce the error in XE6 but not in Berlin. Putting a visibility infront of the const though removed the error when invoking class completion.

– Stefan Glienke
Sep 6 '16 at 11:26





I can reproduce the error in XE6 but not in Berlin. Putting a visibility infront of the const though removed the error when invoking class completion.

– Stefan Glienke
Sep 6 '16 at 11:26













What do you expect to happen when you invoke class completion for this class?

– R. Beiboer
Sep 6 '16 at 11:40





What do you expect to happen when you invoke class completion for this class?

– R. Beiboer
Sep 6 '16 at 11:40













This code snippet works just fine for me in Seattle. Looks like a bug in the IDE that has since been resolved.

– Johan
Sep 6 '16 at 11:43





This code snippet works just fine for me in Seattle. Looks like a bug in the IDE that has since been resolved.

– Johan
Sep 6 '16 at 11:43




2




2





@StefanGlienke: Found it: "If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public". So indeed, if inherited from TObject, it is public. If inherited from TPersistent (which is compiled with $M+), it is published.

– Rudy Velthuis
Sep 6 '16 at 15:44





@StefanGlienke: Found it: "If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public". So indeed, if inherited from TObject, it is public. If inherited from TPersistent (which is compiled with $M+), it is published.

– Rudy Velthuis
Sep 6 '16 at 15:44












1 Answer
1






active

oldest

votes


















0














Solved by Stefan Glienke in comment. Actually it's a bug in Delphi XE6 and in other versions it has been resolved. You need to define visibility, public in this case, even if it shouldn't be needed.



GT_Class = class
public
type
TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
TCustomSet = set of TCustomEnum;

const
DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
end;





share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39347223%2fdelphi-rad-studio-class-completion-issue%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Solved by Stefan Glienke in comment. Actually it's a bug in Delphi XE6 and in other versions it has been resolved. You need to define visibility, public in this case, even if it shouldn't be needed.



    GT_Class = class
    public
    type
    TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
    TCustomSet = set of TCustomEnum;

    const
    DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
    end;





    share|improve this answer






























      0














      Solved by Stefan Glienke in comment. Actually it's a bug in Delphi XE6 and in other versions it has been resolved. You need to define visibility, public in this case, even if it shouldn't be needed.



      GT_Class = class
      public
      type
      TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
      TCustomSet = set of TCustomEnum;

      const
      DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
      end;





      share|improve this answer




























        0












        0








        0







        Solved by Stefan Glienke in comment. Actually it's a bug in Delphi XE6 and in other versions it has been resolved. You need to define visibility, public in this case, even if it shouldn't be needed.



        GT_Class = class
        public
        type
        TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
        TCustomSet = set of TCustomEnum;

        const
        DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
        end;





        share|improve this answer















        Solved by Stefan Glienke in comment. Actually it's a bug in Delphi XE6 and in other versions it has been resolved. You need to define visibility, public in this case, even if it shouldn't be needed.



        GT_Class = class
        public
        type
        TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
        TCustomSet = set of TCustomEnum;

        const
        DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
        end;






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 days ago

























        answered Sep 7 '16 at 7:28









        TriberTriber

        8471026




        8471026






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39347223%2fdelphi-rad-studio-class-completion-issue%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Liquibase includeAll doesn't find base path

            How to use setInterval in EJS file?

            Petrus Granier-Deferre