i make push procedure but its not working, there something wrong with my code??
please see my following push procedure :

procedure PUSH (var T: Stack; var Full: boolean;
                     X: integer);
 begin
   if T.Top = MaxElemen then
       Full := true
   else
      begin
        
        T.Top := inc(T.Top);
        T.Contain[T.Top] := X
      end
 end;
dnk commented: thx +1

Recommended Answers

All 3 Replies

i think you forget to set full = false, just it.
add this code after else :

begin
        Full := false;
        T.Top := inc(T.Top);
        T.Contain[T.Top] := X
      end

ok hope this helps..

commented: :D +1
commented: upss..i forgot. thanks for the great helps..want to see your help again +1

oh...great. thanks jx_man. i feel dumb..just caused by a little think.

you're welcome. its ok, everybody can make mistake. happy coding friend :)
all for the best.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.