Error de compilacion en un programa
Publicado por Tomás (1 intervención) el 10/11/2015 22:41:36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
program Project1;
uses crt;
type
lista_usuario=^nodo_usuario;
usuario=record
nombre:string[30];
password:string[30];
end;
nodo_usuario=record
psig_usuario:lista_usuario;
dato_usuario:usuario;
end;
var
rta_usuario:integer;
rta:char;
nuevo_usuario:usuario;
l_u:lista_usuario;
aux_login:usuario;
procedure agregar_usuario(var l_u:lista_usuario;nuevo_usuario:usuario);
var
nuevo:lista_usuario;
begin
new(nuevo);
nuevo^.dato_usuario.nombre:=nuevo_usuario.nombre;
nuevo^.dato_usuario.password:=nuevo_usuario.password;
nuevo^.psig_usuario:=l_u;
l_u:=nuevo;
end;
function busca_usuario(l_u:lista_usuario;nuevo_usuario:usuario):usuario;
var
aux:lista_usuario;
aux2:usuario;
begin
aux:=l_u;
while(aux<>nil)and(aux^.dato_usuario.nombre<>nuevo_usuario.nombre)and(aux^.dato_usuario.password<>nuevo_usuario.password) do
begin
aux:=aux^.psig_usuario;
end;
if (aux=nil)then
begin
writeln('No existe');
aux2.nombre:='nnn';
busca_usuario:=aux2;
end
else
begin
busca_usuario:=aux^.dato_usuario;
end;
end;
procedure login;
begin
writeln(' 1. INGRESAR ');
writeln(' 2. REGISTRARSE ');
readln(rta_usuario);
CASE(rta_usuario) OF
1:
begin
writeln('Ingrese usuario');
readln(nuevo_usuario.nombre);
writeln('Ingrese contraseña');
readln(nuevo_usuario.password);
aux_login:=busca_usuario(l_u,nuevo_usuario);
if(aux_login<>'nnn') then
menu_principal;
end;
2:
begin
writeln('Ingrese usuario');
readln(nuevo_usuario.nombre);
writeln('Ingrese contraseña');
readln(nuevo_usuario.password);
aux_login:=busca_usuario(l_u,nuevo_usuario);
if(aux_login='nnn') then
agregar_usuario(l_u,nuevo_usuario)
else
writeln('Usuario ya existente,ingrese uno nuevo o presione S para salir');
readln(rta);
if(rta='s') then
exit
else
writeln('Ingrese usuario');
readln(nuevo_usuario.nombre);
writeln('Ingrese contraseña');
readln(nuevo_usuario.password);
busca_usuario(l_u,nuevo_usuario);
end;
end;
end;
begin
l_u:=nil;
end.
No puedo hacer que compile, la idea seria que el usuario tenga un menú de login para entrar al menu principal,tira los siguientes errores
Disculpen el desorden el código, desde ya, gracias.
Uso lazarus.
1
2
3
Compilar proyecto, Objetivo: project1.exe: Código de salida 1, Errores: 3
project1.lpr(66,21) Error: Operator is not overloaded: "usuario" = "Constant String"
project1.lpr(77,21) Error: Operator is not overloaded: "usuario" = "Constant String"
Valora esta pregunta


0