Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 18-06-2019
nelsonjguzmans nelsonjguzmans is offline
Registrado
 
Registrado: nov 2018
Posts: 4
Poder: 0
nelsonjguzmans Va por buen camino
Question asi voy

Buenas noches mis estimados disculpen las tardanza, pues he tenido complicaciones familiares y para conectarme, les quería comentar como va mi progreso y tambien que no soy muy diestro con la computadora sin mas preámbulo acá les dejo mi desastre


aca les muestro mi plan, la idea es que el usuario coloque un umbral digamos 5, luego pase a ingresar numeros que al agregar lo mandara al primer StringGrind "lista con todos los numeros". Paso seguido el usuario al hacer click en "Mostrar" les arroje el resultado mayor o menor que al Umbral


he aqui el detalle no se como mostrar el ultimo paso y el umbral.

si me podrian ayudar y explicar con manzanitas les estare muy agradecido

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids;

type
  TipoPila = Record
              Dato: Array[1..4] of integer;
              Tope: 0..4;
             end;
  TipoPilaInv=Record
              Dato:Array [1..4] of integer;
              topei:0..4;
              end;
              
  TForm1 = class(TForm)
    E_INGRESAR: TEdit;
    B_SALIR: TButton;
    B_AGREGAR: TButton;
    B_MOSTRAR: TButton;
    B_REINICIAR: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    SG_NUMEROS: TStringGrid;
    SG_MENUMBRAL: TStringGrid;
    SG_MAYUMBRAL: TStringGrid;
    E_UMBRAL: TEdit;
    B_UMBRAL: TButton;
    procedure B_REINICIARClick(Sender: TObject);
    procedure B_SALIRClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure B_AGREGARClick(Sender: TObject);
    procedure B_MOSTRARClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Pila:TipoPila;
  Pilainversa:TipoPilaInv;
  fila,umb,filai:integer;
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.B_REINICIARClick(Sender: TObject);
begin
begin
 Application.MainForm.Hide;
 WinExec(PChar(ParamStr(0)), SW_NORMAL);
 TerminateProcess(GetCurrentProcess, 0);
end;
end;

procedure TForm1.B_SALIRClick(Sender: TObject);
begin
Close;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Pila.Tope:=0;
  fila:=4;
  filai:=4
end;

procedure TForm1.B_AGREGARClick(Sender: TObject);
begin
    If Pila.Tope<4 Then
   Begin
     E_INGRESAR.SetFocus;
     Pila.Tope:= Pila.Tope+1;
     Pila.dato[Pila.Tope]:=StrToInt(E_INGRESAR.text);
     SG_NUMEROS.Cells [0,fila-1]:= IntToStr(Pila.dato[Pila.Tope]);
     fila:=fila-1;
     E_INGRESAR.Clear;E_INGRESAR.SetFocus;
  end;
  If Pila.Tope=4 then
   Begin
    Showmessage('Pila LLena');
    fila:=0;
    pilainversa.topei:=0;
   End;
end;

procedure TForm1.B_MOSTRARClick(Sender: TObject);

begin
  If Pila.Tope<=4 Then
   Begin
     PilaInversa.Topei:= PilaInversa.Topei+1;
     PilaInversa.Dato[Pilainversa.Topei]:=Pila.dato[Pila.Tope];
     SG_MENUMBRAL.Cells [0,filai-1]:= IntToStr(PilaInversa.dato[PilaInversa.Topei]);
     SG_MAYUMBRAL.Cells [0,filai-1]:= IntToStr(PilaInversa.dato[PilaInversa.Topei]);
     filai:=filai-1;
     Pila.Tope:=Pila.Tope-1;
   end;
  If Pilainversa.Topei=4 then
   Begin
    Showmessage('Pila LLena');
    End;

end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Sistema de Colas Choclito OOP 3 28-06-2011 18:51:59
Colas y pilas ebanibaldo JAVA 6 27-04-2010 00:29:53
Clases - pilas - colas Manshula OOP 6 21-05-2008 20:05:15
Pedido de Ayuda (Arboles bianrios, pilas y colas) theundertakker Varios 1 07-12-2005 20:03:34
informacion sobre listas,colas y pilas Lizita Varios 2 09-05-2005 10:02:29


La franja horaria es GMT +2. Ahora son las 01:00:10.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi