Stack class

  1. 3 weeks 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 Europe (Germany)
    Edited 3 weeks ago

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

    super.constructor

    is the equivalent of the inherited keyword.

  3. Norman P

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

    @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. 2 weeks ago

    It's clear thanks to you both.

  5. Christian S

    Jun 11 Pre-Release Testers, Xojo Pro, XDC Speakers 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!