Archivos de texto (Scilab)
Publicado por Juan Tristán (1 intervención) el 28/04/2015 04:11:59
Buenas tardes, alguien me podría decir por que no se activa la function Agregar () , después de oprimir el botón, o mas bien, que es lo que tengo mal .
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function BotonAgregar()
h= figure() //CREAR FIGURA EN LA VENTANA
//CARACTERÍSTICAS DEL BOTÓN AGREGAR
boton1= uicontrol ( h, "style", "pushbutton")
boton1.Position=[ 50 200 200 50 ] // x y w h
boton1.String = " Agregar amigo " //nombre que aparece en el boton
boton1.BackgroundColor = [0,9,0,9,0,9]
boton1.Callback = "Agregar" // funcion a la que se llama si oprime el boton
endfunction
function Agregar ()
arch= mopen ("F:\CARRERA 2NDO SEMESTRE\PROGRAMACION\PROYECTO 2NDO PARCIAL\Agenda.txt","a")//abrimos el archivo agenda para agregar los datos
nombre="Azucena"
apellido= "Libra"
edad= 45
calif= 98.5
//escribimos en el archivo las variables que pedimos en ese orden
mfprintf(arch, " %s %s %i %f\n", nombre, apellido, edad, calif)
mclose (arch)//cerramos el archivo
disp("ya se agrego")
endfunction
Valora esta pregunta
0