Jump to content


Delphi


  • Faça o login para participar
5 replies to this topic

#1 Leandro Prado

Leandro Prado
  • Visitantes

Posted 03/08/2003, 02:07

estou fazenso o curso de delhpi oferecido pelo sait de vcs, tem um exemplo ptoposto de criar um menu quando chega para colocar o codigo para a opcção salvar esta dando erro de compilação e o codigo esta certo..queria a ajuda de vcs o mais rapido possivel..
obrigado..

#2 Web Developer

Web Developer

    12 Horas

  • Usuários
  • 283 posts
  • Sexo:Masculino
  • Localidade:Porto Alegre - RS
  • Interesses:Desenvolvimento Web.

Posted 03/08/2003, 03:42

Para que possamos ajudá-lo, terá de por o code aqui no fórum... Pois não é todos que sabem do que se trata... Por favor coloque o code... :ok:
PHP não é coisa pra muleque!

#3 phmda

phmda

    Expert

  • Usuários
  • 590 posts
  • Sexo:Não informado
  • Localidade:São Paulo - SP

Posted 05/08/2003, 21:09

ae cara posta o código ai também to aprendendo delphi e deixa eu ver se eu consigo te ajudar. :ok: :ok:
www.phmda.com.br

#4 xleandro

xleandro

    Saber eh poder

  • Usuários
  • 359 posts
  • Sexo:Não informado
  • Localidade:ES
  • Interesses:Linguagens de programaçao, SO`s, hardwares e softwares.

Posted 25/03/2004, 02:35

Põe o codigo ae, senao fika dificil neh heheh

[]`s

:)
Nesta guerra jah conquistamos grandes e pequenas batalhas, desde as mais faceis ateh akelas que para qualquer outro mortal seria dita como inalcansavel, mas então, pq continuar? Simples...
Pq o mais importante não eh vencer todas as batalhas, mas sim perpetuar a guerra. ;o)

Meu fotolog: http://www.pixlog.net/xleandro
Leandro Pretti

#5 alansantana

alansantana

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado

Posted 23/10/2005, 09:31

pode me ajudar

Olá
Bom dia
Tenho esses quatro popgramas, e preciso passa-los para pascal.
Se conhece as duas linguagens ajude me por favor.
Mande para alan.santana@gmail.com ou
alan_santana@terra.com.br
Obrigado

programa_01

#include <stdio.h>
/* So definindo os limites da tabela.em pascal acho que é com CONST */
#define LINHA 3
#define COLUNA 3

void LeMatriz(int MAT[][COLUNA])
{ int i,j;
for(i=0;i<LINHA;i++)
for (j=0;j<COLUNA;j++)
scanf("%d",&MAT[i][j]);
}


int SomaLinha(int MAT[][COLUNA],int ATUAL_COLUNA,int LINHA_ATUAL)
{ if(ATUAL_COLUNA>=COLUNA)
return 0;
else
return SomaLinha(MAT,ATUAL_COLUNA+1,LINHA_ATUAL)+MAT[LINHA_ATUAL][ATUAL_COLUNA];
}


int SomaTudo(int MAT[][COLUNA],int LINHA_ATUAL,int COLUNA_ATUAL)
{ if(LINHA_ATUAL>=LINHA)
return 0;
else
return SomaLinha(MAT,COLUNA_ATUAL,LINHA_ATUAL)+SomaTudo(MAT,LINHA_ATUAL+1,COLUNA_ATUAL);
}

main()
{
int MAT[LINHA][COLUNA]={0};
int i;
LeMatriz(MAT);
printf ("\n%d\n",SomaTudo(MAT,0,0));
}


____________________________________________________________________
programa_02

#include <stdio.h>
#include <stdlib.h>
#define VEZES 5

struct NODO{
int DADO;
struct NODO *PROX;
} typedef Elemento;


void InsereFinal(Elemento *INICIO,Elemento *NO)
{
if (INICIO->PROX==NULL)
{ INICIO->PROX=NO;
return;
}
else
InsereFinal(INICIO->PROX,NO);
}


void InsereNaPosicao(Elemento *INICIO,Elemento *NO,int CONTADOR,int POS)
{
if (CONTADOR==POS-1)
{ NO->PROX=INICIO->PROX;
INICIO->PROX=NO;
return;
}
else
InsereNaPosicao(INICIO->PROX,NO,CONTADOR+1,POS);
}

/* Só pra ver como tá a bagunça */
void ImprimeLista(Elemento *INICIO)
{
if (INICIO==NULL)
return;
else
{ printf (" %d ",INICIO->DADO);
ImprimeLista(INICIO->PROX);
}
}

main()
{
Elemento *HEAD=malloc(sizeof(Elemento));
Elemento *TEMP;
int QTDE=0;
int X=1;
int POS;

HEAD->PROX=NULL;
while (X<=VEZES)
{ TEMP=malloc(1*sizeof(Elemento));
TEMP->PROX=NULL;
printf ("\nInserir elemento:");
scanf("%d",&(*TEMP).DADO);
printf("\nPosicao:");
scanf("%d",&POS);

if (POS>QTDE)
{ if (QTDE==0)
InsereFinal(HEAD,TEMP);
else
InsereFinal(HEAD->PROX,TEMP);
}
else if (POS>0)
InsereNaPosicao(HEAD,TEMP,0,POS);
else printf ("digite uma posicao maior que zero");
QTDE++;
X++;
ImprimeLista(HEAD->PROX);
}
else
{ printf (" %d ",INICIO->DADO);
ImprimeLista(INICIO->PROX);
}
}

main()
{
Elemento *HEAD=malloc(sizeof(Elemento));
Elemento *TEMP;
int QTDE=0;
int X=1;
int POS;

HEAD->PROX=NULL;
while (X<=VEZES)
{ TEMP=malloc(1*sizeof(Elemento));
TEMP->PROX=NULL;
printf ("\nInserir elemento:");
scanf("%d",&(*TEMP).DADO);
printf("\nPosicao:");
scanf("%d",&POS);

if (POS>QTDE)
{ if (QTDE==0)
InsereFinal(HEAD,TEMP);
else
InsereFinal(HEAD->PROX,TEMP);
}
else if (POS>0)
InsereNaPosicao(HEAD,TEMP,0,POS);
else printf ("digite uma posicao maior que zero");
QTDE++;
X++;
ImprimeLista(HEAD->PROX);
}

free(HEAD);
}
____________________________________________________________________
programa_03

#include <stdio.h>
#include <stdlib.h>

struct NODO
{ int DADO;
struct NODO *PROX;
} typedef Elemento;


void TelaOpcao()
{ printf ("\n1-Inserir Numero");
printf ("\n2-Sair\n");
}


void InsereLista(Elemento *INICIO,Elemento *NO)
{
if (INICIO->PROX==NULL)
{ NO->PROX=INICIO->PROX;
INICIO->PROX=NO;
return;
}
else
InsereLista(INICIO->PROX,NO);
}

void ImprimeLista(Elemento *INICIO,int QTDE)
{
if (INICIO==NULL)
printf ("\nLista vazia\n");
else
{ while (INICIO!=NULL)
{ printf (" %d ",INICIO->DADO);
INICIO=INICIO->PROX;
}
printf ("\nElementos na lista:%d\n",QTDE);
}
}

void PrimeiraOpcao(Elemento *INICIO,int *QTDE)
{
int NUM;
Elemento *TMP=malloc(sizeof(Elemento));
printf("\nNúmero (digite -1 para imprimir a lista)");
scanf("%d",&NUM);
if(NUM!=-1)
{ TMP->DADO=NUM;
InsereLista(INICIO,TMP);
(*QTDE)++;
}
else
ImprimeLista(INICIO->PROX,(*QTDE));
}

void SegundaOpcao(Elemento *HEAD)
{ free(HEAD); }

main()
{
int OPCAO,QTDE=0;
Elemento *HEAD=malloc(sizeof(Elemento));

do
{
TelaOpcao();
scanf("%d",&OPCAO);
switch(OPCAO) {
case 1:
PrimeiraOpcao(HEAD,&QTDE);
break;
case 2:
SegundaOpcao(HEAD);
break;
default: printf ("\nNao existe essa opcao");
}
}while (OPCAO && OPCAO!=2);
}
____________________________________________________________________
programa_04

#include <stdio.h>
#include <stdlib.h>
#define VEZES 10

struct NODO
{ int NUM;
struct NODO *PROX;
} typedef Elemento;


void Opcoes()
{ printf ("\n1-Inserir Numero\n2-Remover Numero\n");
printf ("\n3-No Final da Lista\n4-No inicio da lista\\n");
printf ("\n>>");
}

void LeituraNumero(Elemento *TMP)
{ printf ("\nDigite o numero a ser inserido:");
scanf("%d",&(*TMP).NUM);
}

void InsereNumero(Elemento *INICIO,Elemento *NO,int OP)
{ if (OP==4)
{ NO->PROX=INICIO->PROX;
INICIO->PROX=NO;
}
else if (OP==3)
{ if (INICIO->PROX!=NULL)
while (INICIO->PROX!=NULL)
INICIO=INICIO->PROX;

NO->PROX=NULL;
INICIO->PROX=NO;
}
}

void RemoveNumero(Elemento *INICIO,int OP)
{ Elemento *TMP;

if (OP==4)
{
TMP=INICIO->PROX;
INICIO->PROX=INICIO->PROX->PROX;
free(TMP);
}
else if (OP==3)
{ if (INICIO->PROX!=NULL)
{ while (INICIO->PROX->PROX!=NULL)
INICIO=INICIO->PROX;
free(INICIO->PROX);
INICIO->PROX=NULL;
}
}
}

void ImprimeLista(Elemento *NO)
{ while (NO!=NULL)
{ printf (" %d ",NO->NUM);
NO=NO->PROX;
}
}

main()
{
Elemento *HEAD=malloc(sizeof(Elemento));
Elemento *TMP;
int OP1,OP2,X=0;

while (X<VEZES)
{
Opcoes();
scanf("%d %d",&OP1,&OP2);

if (OP1==1)
{ TMP=malloc(sizeof(Elemento));
LeituraNumero(TMP);
InsereNumero(HEAD,TMP,OP2);
}
else if (OP1==2 && HEAD->PROX!=NULL)
RemoveNumero(HEAD,OP2);

ImprimeLista(HEAD->PROX);
X++;
}
free(HEAD);
}

#6 proteus_adi

proteus_adi

    @handle:=proteus;//>>>

  • Usuários
  • 309 posts
  • Sexo:Não informado
  • Localidade:Minas Gerais&gt;&gt; Belo Horizonte
  • Interesses:Programação e Web&gt;&gt;&gt;

Posted 23/10/2005, 18:45

ahm???
PROTEUS [ADSUMUS]
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq