Stack class

  1. 5 months ago

    Hello,
    I could perhaps work around the problem but not knowing all the subtleties of the objects or their syntax I wanted to translate as closely as possible my code from Delphi.
    I am trying to declare a class of stack.

    TStack = Class
    Private
       Fcount : Integer;
    ...
    Public
        Constructor Create;
    ...
      end;
    ...
    Constructor TStack.Create;
    begin
    Inherited;
     Fcount:=0;
     SetLength(List,0);
    end;

    For example, can a name be given to the Constructor (Create) and how to deal with the Inherited keyword?

    Thanks in advance.
    BB

  2. Beatrix W

    Jun 4 Pre-Release Testers, Third Party Store Europe (Germany)
    Edited 5 months ago

    Constructors don't have names in Xojo. As far as I understand using

    super.constructor

    is the equivalent of the inherited keyword.

  3. 4 months ago

    Norman P

    Jun 4 Pre-Release Testers, Xojo Pro great-white-software.com/blog

    @BenoîtBouillon Hello,
    I could perhaps work around the problem but not knowing all the subtleties of the objects or their syntax I wanted to translate as closely as possible my code from Delphi.

    Writing delphi in Xojo is bound to lead you to have issues

  4. It's clear thanks to you both.

  5. Christian S

    Jun 11 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    you won't need a stack class in Xojo.
    The normal arrays will do and have an append and pop method already.

or Sign Up to reply!