Código:
Function BD_objetos()
Cls
Locate 0,0
dir_base$=CurrentDir()+"BD_objetos\"
If FileType(dir_base$)=0
CreateDir dir_base$
EndIf
.lista_BD
Cls
Locate 0,0
Print "Inserte el nombre de la base de datos."
dat$=Input()
If dat$=""
.salida_inicial
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "¿Desea salir del programa?. (S/N)"
dat$=Input()
If dat$="S" Or dat$="s"
Goto fin_funcion
EndIf
If dat$="N" Or dat$="n"
Goto lista_BD
EndIf
Goto salida_inicial
EndIf
file_base_b$=dir_base$+dat$
database_reg$=dat$
If FileType(file_base_b$)=1
Cls
Locate 0,0
Print "Ya existe un archivo con el nombre indicado."
Print "Pulse una tecla para cargar los datos."
WaitKey()
fileout=ReadFile(file_base_b$)
num_objetos#=ReadFloat(fileout)
If num_objetos#=0
Goto fin_actualizacion_00
EndIf
num_objetos#=num_objetos#-1
Dim lista_objetos$(num_objetos#)
Dim lista_creacion_objetos#(num_objetos#,num_objetos#)
For tr#=0 To num_objetos#
daty$=ReadString(fileout)
lista_objetos$(tr#)=daty$
For trr#=0 To num_objetos#
opciones#=ReadFloat(fileout)
lista_creacion_objetos#(tr#,trr#)=opciones#
Next
Next
num_objetos#=num_objetos#+1
.fin_actualizacion_00
vendedores#=ReadFloat(fileout)
If vendedores#=0
Goto fin_actualizacion_11
EndIf
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
Dim listas_vendedores$(vendedores#)
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
For tr#=0 To vendedores#
dat$=ReadString(fileout)
listas_vendedores$(tr#)=dat$
For trr#=0 To num_objetos#
opciones#=ReadFloat(fileout)
objetos_vendedores#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=ReadFloat(fileout)
objetos_cambio_vendedores#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
.fin_actualizacion_11
CloseFile(fileout)
Cls
Locate 0,0
Print "La base de datos se ha cargado."
Print "Pulse una tecla para continuar al menu principal."
WaitKey()
Goto inicio
EndIf
Cls
Locate 0,0
Print "No existe ninguna base de datos con el nombre indicado."
Print "Pulse una tecla para crearla y seguir."
WaitKey()
.inicio
seeker_database#=0
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Añadir un nuevo objeto a la BD, o bien"
Print " modificar el nombre de un objeto existente."
Print "2) Añadir/quitar objetos para crear un"
Print " objeto especifico."
Print "3) Ver todos los objetos."
Print "4) Ver todos los objetos con los objetos"
Print " necesarios para crearlos.
Print "5) Buscar un objeto con los objetos"
Print " necesarios para crearlo."
Print "6) Ver una lista de objetos que se pueden"
Print " crear con uno o mas objetos."
Print "7) Crear vendedor."
Print "8) Añadir objetos a un vendedor."
Print "9) Ver todos los vendedores."
Print "10) Ver los objetos disponibles de todos los vendedores."
Print "11) Ver los objetos disponibles de un vendedor."
Print "12) Buscar que vendedores venden un determinado objeto."
Print "13) Añadir un objeto de cambio a un vendedor."
Print "14) Ver todos los objetos de cambio de cada vendedor."
Print "15) Ver todos los objetos de cambio de un vendedor."
Print "16) Buscar que objeto es cambiado por uno o mas vendedor."
Print "17) Acceder a las opciones de base de datos de usuarios."
Print "18) Salir del programa."
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
Print "Inserte el nombre del nuevo objeto:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "No ha insertado ningun nombre."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
trx#=0
If num_objetos#=0
Dim lista_objetos$(num_objetos#)
Dim lista_creacion_objetos#(num_objetos#,num_objetos#)
lista_objetos$(num_objetos#)=dat$
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Se ha añadido el objeto a la base de datos."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If num_objetos#>0
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
Print "El objeto indicado ya existe."
Print "Inserte el nuevo nombre para el objeto actual:"
Print "(No inserte nada para descartar los datos y"
Print " volver al menu inicial)."
dat$=Input()
If dat$=""
num_objetos#=num_objetos#+1
Goto inicio
EndIf
For txz#=0 To num_objetos#
If dat$=lista_objetos$(txz#)
Cls
Locate 0,0
Print "El nombre indicado no se puede añadir,"
Print "ya esta en uso."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
Goto inicio
EndIf
Next
lista_objetos$(tr#)=dat$
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "El nombre del objeto se ha modificado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Next
Dim lista_objetos_b$(num_objetos#)
Dim lista_creacion_objetos_b#(num_objetos#,num_objetos#)
For tr#=0 To num_objetos#
dat_b$=lista_objetos$(tr#)
lista_objetos_b$(tr#)=dat_b$
For trr#=0 To num_objetos#
dat_b$=lista_creacion_objetos#(tr#,trr#)
lista_creacion_objetos_b#(tr#,trr#)=dat_b$
Next
Next
num_objetos#=num_objetos#+1
Dim lista_objetos$(num_objetos#)
Dim lista_creacion_objetos#(num_objetos#,num_objetos#)
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
dat_b$=lista_objetos_b$(tr#)
lista_objetos$(tr#)=dat_b$
For trr#=0 To num_objetos#
dat_b$=lista_creacion_objetos_b#(tr#,trr#)
lista_creacion_objetos#(tr#,trr#)=dat_b$
Next
Next
If vendedores#>0
vendedores#=vendedores#-1
Dim objetos_vendedores_b#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores_b#(vendedores#,num_objetos#,num_objetos#)
For tr#=0 To vendedores#
For trr#=0 To num_objetos#
opciones#=objetos_vendedores#(tr#,trr#)
objetos_vendedores_b#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
num_objetos#=num_objetos#+1
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
num_objetos#=num_objetos#-1
For tr#=0 To vendedores#
For trr#=0 To num_objetos#
opciones#=objetos_vendedores_b#(tr#,trr#)
objetos_vendedores#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores_b#(tr#,trr#,trrr#)
objetos_cambio_vendedores#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
vendedores#=vendedores#+1
EndIf
num_objetos#=num_objetos#+1
lista_objetos$(num_objetos#)=dat$
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Se ha añadido el objeto a la base de datos."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
EndIf
If opciones#=2
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If num_objetos#<2
Print "Ha creado menos de 2 objeto."
Print "Debe crear 2 o mas antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del objeto principal:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "No ha insertado ningun nombre."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
Print "Se ha encontrado el objeto indicado."
Print "Pulse una tecla para seguir."
Dim lista_objetos_temp#(num_objetos#)
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
lista_objetos_temp#(trn#)=val#
Next
WaitKey()
.add_quit_object
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Ver una lista de todos los objetos."
Print "2) Ver la lista inicial de objetos necesarios para"
Print " poder crear el objeto principal."
Print "3) Ver la lista actual de objetos necesarios para"
Print " poder crear el objeto principal."
Print "4) Modificar la cantidad de un objeto para poder"
Print " crear el objeto principal."
Print "5) Volver al menu inicial descartando los datos.
Print "6) Volver al menu inicial guardando los datos.
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
trx#=0
For trn#=0 To num_objetos#
num_objetosx#=trn#+1
Print "Objeto no. " + num_objetosx#
Print lista_objetos$(trn#)
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto add_quit_object
EndIf
Cls
Locate 0,0
trx#=0
EndIf
Next
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=2
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
If val#>1
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad necesaria de este objeto:"
Print val#
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto add_quit_object
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
EndIf
EndIf
Next
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=3
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
For trn#=0 To num_objetos#
val#=lista_objetos_temp#(trn#)
If val#>0
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad necesaria de este objeto:"
Print val#
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto add_quit_object
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
EndIf
EndIf
Next
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=4
Cls
Locate 0,0
Print "Inserte el nombre del objeto que desea añadir/quitar"
Print "para crear el objeto principal:"
daty$=Input()
For trn#=0 To num_objetos#
If tr#=trn#
Cls
Locate 0,0
Print "Ha insertado un nombre no valido, ya que es"
Print "el nombre del objeto principal."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If daty$=lista_objetos$(trn#)
val#=lista_objetos_temp#(trn#)
.select_add_or_quit
Cls
Locate 0,0
Print "Cantidad del necesaria del objeto indicado"
Print "para crear el objeto principal:" + val#
Print "¿Que cantidad del objeto indicado se necesita
Print " para crear el objeto principal?."
Print "(Inserte un valor menor a 0 para volver al"
Print " menu anterior descartando el cambio actual)."
val#=Input()
Cls
Locate 0,0
If val#<0
Print "Cantidad no modificada."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
lista_objetos_temp#(trn#)=val#
Cls
Locate 0,0
Print "Cantidad modificada."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado el objeto indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=5
.return_without_saving
Cls
Locate 0,0
Print "¿Realmente desea volver al menu inicial guardando los cambios? (S/N)."
dat$=Input()
If dat$="S" Or dat$="s"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
If dat$="N" Or dat$="n"
Goto add_quit_object
EndIf
Goto return_without_saving
EndIf
If opciones#=6
.return_saving
Cls
Locate 0,0
Print "¿Realmente desea volver al menu inicial guardando los cambios? (S/N)."
dat$=Input()
If dat$="S" Or dat$="s"
For trn#=0 To num_objetos#
val#=lista_objetos_temp#(trn#)
lista_creacion_objetos#(tr#,trn#)=val#
Next
Cls
Locate 0,0
Print "Se han aplicado los cambios."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
Goto inicio
EndIf
If dat$="N" Or dat$="n"
Goto add_quit_object
EndIf
Goto return_saving
EndIf
Goto add_quit_object
EndIf
Next
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "No se ha encontrado ningun objeto con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If opciones#=3
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear uno antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
trx#=0
num_objetos#=num_objetos#-1
For trn#=0 To num_objetos#
num_objetosx#=trn#+1
Print "Objeto no. " + num_objetosx#
Print lista_objetos$(trn#)
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Cls
Locate 0,0
trx#=0
EndIf
Next
num_objetos#=num_objetos#+1
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If opciones#=4
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear uno antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
trx#=0
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
num_objetosx#=trn#+1
Print "Objeto no. " + num_objetosx#
Print lista_objetos$(tr#)
Print ""
trx#=trx#+1
Print "Objetos necesarios para crear este objeto:"
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
If val#>1
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad de este objeto para crear el objeto principal:"
Print val#
Print ""
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
Cls
Locate 0,0
trx#=0
EndIf
EndIf
Next
Print ""
Print "Inserte R o r para volver al menu anterior y"
Print "dejar de ver mas objetos."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Cls
Locate 0,0
Next
num_objetos#=num_objetos#+1
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
.seeker_base
If opciones#=5
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear uno antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del objeto a buscar:"
dat$=Input()
Cls
Locate 0,0
If dat$=""
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
If val#>0
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad de este objeto para crear el objeto principal:"
Print val#
Print ""
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
Cls
Locate 0,0
trx#=0
EndIf
EndIf
Next
Print ""
Print "Ya se ha mostrado el objeto junto a todos"
Print "los objetos necesarios para crearlo."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado ningun objeto con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=6
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If num_objetos#<2
Print "Ha creado menos de 2 objeto."
Print "Debe crear 2 o mas antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
num_objetos#=num_objetos#-1
Dim lista_objetos_c#(num_objetos#)
.obj_base
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Añadir/quitar un objeto base de la lista"
Print " para crear otro objeto.
Print "2) Buscar objetos que se puedan crear con"
Print " todos los objetos indicados."
Print "3) Volver al menu inicial."
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
Print "Inserte el objeto que desea añadir/eliminar"
Print "para crear otro objeto:"
dat$=Input()
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
.i_o_object
Cls
Locate 0,0
If lista_objetos_c#(tr#)=0
Print "¿Realmente desea añadir el objeto indicado de la"
Print " lista para crear otro objeto? (S/N)."
EndIf
If lista_objetos_c#(tr#)=1
Print "¿Realmente desea eliminar el objeto indicado de la"
Print " lista para crear otro objeto? (S/N)."
EndIf
dat$=Input()
If dat$="S" Or dat$="s"
If lista_objetos_c#(tr#)=1
lista_objetos_c#(tr#)=0
Cls
Locate 0,0
Print "Objeto eliminado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_base
EndIf
If lista_objetos_c#(tr#)=0
lista_objetos_c#(tr#)=1
Cls
Locate 0,0
Print "Objeto añadido."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_base
EndIf
EndIf
If dat$="N" Or dat$="n"
Goto obj_base
EndIf
Goto i_o_object
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado el objeto indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_base
EndIf
If opciones#=2
.total_objs
Cls
Locate 0,0
Print "¿Los objetos que se van a mostrar deben incluir"
Print " todos los objetos que se acaban de añadir? (S/N)."
daty$=Input()
vary#=0
var_03#=0
If daty$="S" Or daty$="s"
For tr#=0 To num_objetos#
vary#=0
varz#=0
For trr#=0 To num_objetos#
If lista_objetos_c#(trr#)=1
vary#=vary#+1
EndIf
Next
For trr#=0 To num_objetos#
If lista_objetos_c#(trr#)=1
If lista_creacion_objetos#(tr#,trr#)=1
varz#=varz#+1
EndIf
EndIf
Next
If vary#=varz#
var_03#=1
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
var_02#=0
For trn#=0 To num_objetos#
var_00#=lista_objetos_c#(trn#)
var_01#=lista_creacion_objetos#(tr#,trn#)
If var_01#>0
If var_00#=1
Print lista_objetos$(trn#) + " (Objeto indicado en la busqueda)"
EndIf
If var_00#=0
Print lista_objetos$(trn#) + " (Objeto no indicado en la busqueda)"
EndIf
Print "Cantidad de este objeto para crear el objeto principal:"
Print var_01#
Print ""
EndIf
var_02#=var_02#+1
If var_02#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
var_02#=0
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
EndIf
Next
Print ""
Print "No hay mas datos que mostrar de este objeto."
Print "Inserte R o r para volver al menu anterior, o bien"
Print "otra cosa para seguir."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
EndIf
Next
Goto mensaje_fin_busquedas_0x0
EndIf
If daty$="N" Or daty$="n"
For tr#=0 To num_objetos#
For trr#=0 To num_objetos#
var_00#=lista_objetos_c#(trr#)
var_01#=lista_creacion_objetos#(tr#,trr#)
If var_00#=1
If var_01#>1
var_03#=1
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
var_02#=0
For trn#=0 To num_objetos#
var_00#=lista_objetos_c#(trn#)
var_01#=lista_creacion_objetos#(tr#,trn#)
If var_01#>0
If var_00#=1
Print lista_objetos$(trn#) + " (Objeto indicado en la busqueda)"
EndIf
If var_00#=0
Print lista_objetos$(trn#) + " (Objeto no indicado en la busqueda)"
EndIf
Print "Cantidad de este objeto para crear el objeto principal:"
Print var_01#
Print ""
EndIf
var_02#=var_02#+1
If var_02#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
var_02#=0
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
EndIf
Next
Print ""
Print "No hay mas datos que mostrar de este objeto."
Print "Inserte R o r para volver al menu anterior, o bien"
Print "otra cosa para seguir."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
Goto obj_base_nn
EndIf
EndIf
Next
.obj_base_nn
Next
.mensaje_fin_busquedas_0x0
If var_03#=1
Cls
Locate 0,0
Print "Ya se han mostrado todos los objetos que se"
Print "pueden crear con los objetos indicados."
Print "Pulse una tecla para volver al menu anterior."
EndIf
If var_03#=0
Print "No se puede crear ningun objeto con los que"
Print "se han indicado."
Print "Pulse una tecla para volver al menu anterior."
EndIf
WaitKey()
Goto obj_base
EndIf
Goto total_objs
EndIf
If opciones#=3
.return_op_05
Cls
Locate 0,0
If seeker_database#=1
Print "¿Realmente desea volver al menu anterior? (S/N)."
EndIf
If seeker_database#=0
Print "¿Realmente desea volver al menu inicial? (S/N)."
EndIf
dat$=Input()
If dat$="S" Or dat$="s"
num_objetos#=num_objetos#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If dat$="N" Or dat$="n"
Goto obj_base
EndIf
Goto return_op_05
EndIf
Goto obj_base
EndIf
If opciones#=7
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del nuevo vendedor:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
num_objetos#=num_objetos#-1
Dim listas_vendedores$(vendedores#)
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
listas_vendedores$(vendedores#)=dat$
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Vendedor creado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If vendedores#>0
vendedores#=vendedores#-1
For tr#=0 To vendedores#
If dat$=listas_vendedores$(tr#)
Cls
Locate 0,0
Print "Ya existe un vendedor con el nombre indicado."
Print "Inserte el nuevo nombre para este vendedor:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
For trr#=0 To vendedores#
If dat$=listas_vendedores$(trr#)
Cls
Locate 0,0
vendedores#=vendedores#+1
Print "El nombre indicado ya esta en uso."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Next
vendedores#=vendedores#+1
listas_vendedores$(tr#)=dat$
Cls
Locate 0,0
Print "Se ha modificado el nombre del vendedor."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Next
num_objetos#=num_objetos#-1
Dim listas_vendedores_b$(vendedores#)
Dim objetos_vendedores_b#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores_b#(vendedores#,num_objetos#,num_objetos#)
For tr#=0 To vendedores#
dat_b$=listas_vendedores$(tr#)
listas_vendedores_b$(tr#)=dat_b$
For trr#=0 To num_objetos#
opciones#=objetos_vendedores#(tr#,trr#)
objetos_vendedores_b#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
vendedores#=vendedores#+1
Dim listas_vendedores$(vendedores#)
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
vendedores#=vendedores#-1
For tr#=0 To vendedores#
dat_b$=listas_vendedores_b$(tr#)
listas_vendedores$(tr#)=dat_b$
For trr#=0 To num_objetos#
opciones#=objetos_vendedores_b#(tr#,trr#)
objetos_vendedores#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
listas_vendedores$(vendedores#)=dat$
vendedores#=vendedores#+1
Cls
Locate 0,0
Print "Se ha creado un vendedor con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
EndIf
If opciones#=8
Cls
Locate 0,0
Print "Inserte el nombre del vendedor para incluir"
Print "los objetos que vende:"
dat$=Input()
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
For tr#=0 To vendedores#
Dim objetos_vendedores_b#(0,num_objetos#)
For trr#=0 To num_objetos#
opciones#=objetos_vendedores#(tr#,trr#)
objetos_vendedores_b#(0,trr#)=opciones#
Next
If dat$=listas_vendedores$(tr#)
.incluir_obj_vendedor
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Ver la lista inicial de objetos incluidos."
Print "2) Ver la lista actual de objetos incluidos."
Print "3) Añadir/quitar un objeto a este vendedor."
Print "4) Volver al menu inicial aplicando los cambios."
Print "5) Volver al menu inicial descartando los cambios."
opciones#=Input()
If opciones#=1
trr#=0
Cls
Locate 0,0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores#(tr#,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " :" + opciones#
EndIf
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
If dat$="R" Or dat$="r"
Goto incluir_obj_vendedor
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
Next
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto incluir_obj_vendedor
EndIf
If opciones#=2
trr#=0
Cls
Locate 0,0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores_b#(0,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " :" + opciones#
EndIf
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
If dat$="R" Or dat$="r"
Goto incluir_obj_vendedor
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
Next
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto incluir_obj_vendedor
EndIf
If opciones#=3
Cls
Locate 0,0
Print "Inserte el nombre del objeto que desea"
Print "añadir/eliminar al vendedor actual:"
dat$=Input()
For trr#=0 To num_objetos#
If dat$=lista_objetos$(trr#)
Cls
Locate 0,0
opciones#=objetos_vendedores_b#(0,trr#)
Print "Nombre del objeto: " + dat$
Print "Precio del objeto: " + objetos_vendedores_b#(0,trr#)
Print ""
Print "Inserte el nuevo precio del objeto:"
Print "(Inserte 0 para eliminar el objeto de la"
Print " lista del vendedor)."
Print "(Inserte un valor menor a 0 para no"
Print " realizar ningun cambio)."
opciones#=Input()
If opciones#<0
Print ""
Print "No se a aplicado el cambio."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto incluir_obj_vendedor
EndIf
objetos_vendedores_b#(0,trr#)=opciones#
Print ""
Print "Se a aplicado el cambio."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto incluir_obj_vendedor
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado ningun objeto con el nombre indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto incluir_obj_vendedor
EndIf
If opciones#=4
.vuelta_menu_ant_0000
Cls
Locate 0,0
Print "¿Realmente desea volver al menu anterior"
Print " aplicando todos los cambios? (S/N)."
dat$=Input()
If dat$="N" Or dat$="n"
Goto incluir_obj_vendedor
EndIf
If dat$="S" Or dat$="s"
For trr#=0 To num_objetos#
opciones#=objetos_vendedores_b#(0,trr#)
objetos_vendedores#(tr#,trr#)=opciones#
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Se han aplicado los cambios."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
Goto vuelta_menu_ant_0000
EndIf
If opciones#=5
.vuelta_menu_ant_0011
Cls
Locate 0,0
Print "¿Realmente desea volver al menu anterior"
Print " descartando todos los cambios? (S/N)."
dat$=Input()
If dat$="N" Or dat$="n"
Goto incluir_obj_vendedor
EndIf
If dat$="S" Or dat$="s"
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Goto vuelta_menu_ant_0011
EndIf
Goto incluir_obj_vendedor
EndIf
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "No existe ningun vendedor con el nombre indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If opciones#=9
Cls
Locate 0,0
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
trx#=0
vendedores#=vendedores#-1
For tr#=0 To vendedores#
trr#=tr#+1
Print "Vendedor no. " + trr# + ": "
Print listas_vendedores$(tr#)
trx#=trx#+1
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu inicial."
dat$=Input()
Cls
Locate 0,0
If dat$="R" Or dat$="r"
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
EndIf
Next
vendedores#=vendedores#+1
Print "No hay mas vendedores a mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=10
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear almenos 1 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
num_objetos#=num_objetos#-1
vendedores#=vendedores#-1
For tr#=0 To vendedores#
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores#(tr#,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " : " + opciones#
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
Cls
Locate 0,0
If dat$="R" Or dat$="r"
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
EndIf
Next
Print ""
Print "Se han monstrado todos los objetos que"
Print "ofrece este vendedor."
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
Cls
Locate 0,0
If dat$="R" Or dat$="r"
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=11
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear almenos 1 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
trx#=0
Print "Indique el nombre del vendedor para ver los"
Print "objetos que vende:"
Print "(No inserte nada para ver los objetos que"
Print " tienen disponibles todos los vendedores)."
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "No ha insertado ningun nombre/valor."
Print "Debe insertar almenos uno para acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
For tr#=0 To vendedores#
If dat$=listas_vendedores$(tr#)
Cls
Locate 0,0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores#(tr#,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " :" + opciones#
EndIf
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
If dat$="R" Or dat$="r"
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
Cls
Locate 0,0
Print "No se ha encontrado ningun vendedor con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=12
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear almenos 1 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Cls
Locate 0,0
Print "Indique el objeto en cuestion:"
dat$=Input()
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
tx#=0
Print "Nombre del objeto:"
Print lista_objetos$(tr#)
Print ""
Print "Nombre del vendedor que dispone del objeto indicado/precio del objeto:
For trr#=0 To vendedores#
opciones#=objetos_vendedores#(trr#,tr#)
If opciones#>0
Print listas_vendedores$(trr#) + " / " + objetos_vendedores#(trr#,tr#)
tx#=tx#+1
If tx#=10
Print ""
Print "Inserte R o r para volver al menu inicial."
dat$=Input()
If dat$="R" Or dat$="r"
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Cls
Locate 0,0
tx#=0
Print "Nombre del objeto:"
Print lista_objetos$(tr#)
Print ""
Print "Nombre del vendedor que dispone del objeto indicado/precio del objeto:
EndIf
EndIf
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Print "No hay mas vendedores que vendan el objeto indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "No se ha encontrado el objeto indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If seeker_database#=1
Goto database_users
EndIf
If opciones#=13
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del vendedor para"
Print "añadirle objetos de cambio:"
dat$=Input()
num_objetos#=num_objetos#-1
vendedores#=vendedores#-1
For tr#=0 To vendedores#
If dat$=listas_vendedores$(tr#)
Dim objetos_cambio_vendedores_b#(0,num_objetos#,num_objetos#)
For trr#=0 To num_objetos#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(0,trr#,trrr#)=opciones#
Next
Next
.obj_cambios_vendedores
Cls
Locate 0,0
Print "Que desea hacer?."
Print "1) Ver la lista inicial de objetos que cambia el vendedor actual."
Print "2) Ver la lista actual de objetos que cambia el vendedor actual."
Print "3) Añadir/quitar un objeto de la lista del vendedor."
Print "4) Volver al menu anterior descartando los cambios."
Print "5) Volver al menu anterior aplicando los cambios."
opciones#=Input()
If opciones#=1
trnn#=0
For trr#=0 To num_objetos#
For trrr#=0 To num_objetos#
If trrr#=trr#
Goto next_obj_de_cambio_vendedor_001yy
EndIf
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
If opciones#>0
trn#=0
trnn#=1
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
Print "Nombre de los objetos que requiere y su cantidad:"
Print ""
For trx#=0 To num_objetos#
If trx#=trr#
Goto next_obj_de_cambio_vendedor_001yy01
EndIf
opciones#=objetos_cambio_vendedores#(tr#,trr#,trx#)
If opciones#>0
Print lista_objetos$(trx#) + " : " + opciones#
Print ""
trn#=trn#+1
If trn#=7
Print ""
Print "Inserte R o r para volver al menu anterior."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
EndIf
EndIf
.next_obj_de_cambio_vendedor_001yy01
Next
Print "Inserte R o r para volver al menu anterior y"
Print "dejar de ver los objetos que cambia este vendedor."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Goto next_obj_de_cambio_vendedor
EndIf
.next_obj_de_cambio_vendedor_001yy
Next
.next_obj_de_cambio_vendedor
Next
Cls
Locate 0,0
If trnn#=0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia ningun objeto."
EndIf
If trnn#=1
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia mas objetos."
EndIf
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_cambios_vendedores
EndIf
If opciones#=2
trnn#=0
For trr#=0 To num_objetos#
For trrr#=0 To num_objetos#
If trrr#=trr#
Goto next_obj_de_cambio_vendedor_001xx
EndIf
opciones#=objetos_cambio_vendedores_b#(0,trr#,trrr#)
If opciones#>0
trn#=0
trnn#=1
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
Print "Nombre de los objetos que requiere y su cantidad:"
Print ""
For trx#=0 To num_objetos#
If trx#=trr#
Goto next_obj_de_cambio_vendedor_001yy02
EndIf
opciones#=objetos_cambio_vendedores_b#(0,trr#,trx#)
If opciones#>0
Print lista_objetos$(trx#) + " : " + opciones#
Print ""
trn#=trn#+1
If trn#=7
Print ""
Print "Inserte R o r para volver al menu anterior."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
EndIf
EndIf
.next_obj_de_cambio_vendedor_001yy02
Next
Print "Inserte R o r para volver al menu anterior y"
Print "dejar de ver los objetos que cambia este vendedor."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Goto next_obj_de_cambio_vendedor_001
EndIf
.next_obj_de_cambio_vendedor_001xx
Next
.next_obj_de_cambio_vendedor_001
Next
Cls
Locate 0,0
If trnn#=0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia ningun objeto."
EndIf
If trnn#=1
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia por mas objetos."
EndIf
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_cambios_vendedores
EndIf
If opciones#=3
Cls
Locate 0,0
Print "Indique el objeto que desea añadir al vendedor actual:"
dat$=Input()
For trr#=0 To num_objetos#
If dat$=lista_objetos$(trr#)
Dim object_required_changes#(num_objetos#)
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores_b#(0,trr#,trrr#)
object_required_changes#(trrr#)=opciones#
Next
.opcs_cambio_obj_vendedor
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Ver la lista actual de objetos que requiere el vendedor."
Print "2) Modificar la cantidad que el vendedor requiere de un objeto."
Print "3) Modificar las unidades que se ofrece del objeto actual."
Print "4) Eliminar este objeto de la lista de cambios del vendedor"
Print " y volver al menu anterior."
Print "5) Volver al menu anterior descartando los cambios."
Print "6) Volver al menu anterior aplicando los cambios."
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
trn#=0
trnn#=0
Print "Lista de objetos requeridos para el cambio:"
Print "(Nombre/cantidad del objeto)."
Print ""
For trrr#=0 To num_objetos#
If trrr#=trr#
Goto saltos_999999
EndIf
opciones#=object_required_changes#(trrr#)
If opciones#>0
trnn#=1
trn#=trn#+1
Print lista_objetos$(trrr#) + " :" + opciones#
If trn#=7
trn#=0
Print "Inserte R o r para volver al menu anterior."
dat$=Input()
If dat$="R" Or dat$="r"
Goto opcs_cambio_obj_vendedor
EndIf
Cls
Locate 0,0
Print "Lista de objetos requeridos para el cambio:"
Print "(Nombre/cantidad del objeto)."
Print ""
EndIf
EndIf
.saltos_999999
Next
If trnn#=0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia ningun objeto."
EndIf
If trnn#=1
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia por mas objetos."
EndIf
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto opcs_cambio_obj_vendedor
EndIf
If opciones#=2
Cls
Locate 0,0
Print "Inserte el nombre del objeto requerido:"
dat$=Input()
For trrr#=0 To num_objetos#
If dat$=lista_objetos$(trrr#)
If trr#=trrr#
Print "No se puede acceder a esta opcion."
Print "El objeto que ha indicado es el mismo que"
Print "el vendedor ofrece."
Print "Pulse una tecla para volver almenu anterior."
WaitKey()
Goto opcs_cambio_obj_vendedor
EndIf
Cls
Locate 0,0
Print "Nombre del objeto requerido:"
Print lista_objetos$(trrr#)
Print ""
Print "Cantidad requerida de este objeto:"
Print object_required_changes#(trrr#)
Print ""
Print "Inserte la nueva cantidad requerida de este objeto:"
Print "(Inserte 0 para que este objeto no sea necesario"
Print " para realizar el cambio)."
Print "(Inserte un valor menor a 0 para no aplicar ningun"
Print " cambio a este objeto)."
opciones#=Input()
If opciones#<0
Cls
Locate 0,0
dir_base$=CurrentDir()+"BD_objetos\"
If FileType(dir_base$)=0
CreateDir dir_base$
EndIf
.lista_BD
Cls
Locate 0,0
Print "Inserte el nombre de la base de datos."
dat$=Input()
If dat$=""
.salida_inicial
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "¿Desea salir del programa?. (S/N)"
dat$=Input()
If dat$="S" Or dat$="s"
Goto fin_funcion
EndIf
If dat$="N" Or dat$="n"
Goto lista_BD
EndIf
Goto salida_inicial
EndIf
file_base_b$=dir_base$+dat$
database_reg$=dat$
If FileType(file_base_b$)=1
Cls
Locate 0,0
Print "Ya existe un archivo con el nombre indicado."
Print "Pulse una tecla para cargar los datos."
WaitKey()
fileout=ReadFile(file_base_b$)
num_objetos#=ReadFloat(fileout)
If num_objetos#=0
Goto fin_actualizacion_00
EndIf
num_objetos#=num_objetos#-1
Dim lista_objetos$(num_objetos#)
Dim lista_creacion_objetos#(num_objetos#,num_objetos#)
For tr#=0 To num_objetos#
daty$=ReadString(fileout)
lista_objetos$(tr#)=daty$
For trr#=0 To num_objetos#
opciones#=ReadFloat(fileout)
lista_creacion_objetos#(tr#,trr#)=opciones#
Next
Next
num_objetos#=num_objetos#+1
.fin_actualizacion_00
vendedores#=ReadFloat(fileout)
If vendedores#=0
Goto fin_actualizacion_11
EndIf
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
Dim listas_vendedores$(vendedores#)
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
For tr#=0 To vendedores#
dat$=ReadString(fileout)
listas_vendedores$(tr#)=dat$
For trr#=0 To num_objetos#
opciones#=ReadFloat(fileout)
objetos_vendedores#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=ReadFloat(fileout)
objetos_cambio_vendedores#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
.fin_actualizacion_11
CloseFile(fileout)
Cls
Locate 0,0
Print "La base de datos se ha cargado."
Print "Pulse una tecla para continuar al menu principal."
WaitKey()
Goto inicio
EndIf
Cls
Locate 0,0
Print "No existe ninguna base de datos con el nombre indicado."
Print "Pulse una tecla para crearla y seguir."
WaitKey()
.inicio
seeker_database#=0
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Añadir un nuevo objeto a la BD, o bien"
Print " modificar el nombre de un objeto existente."
Print "2) Añadir/quitar objetos para crear un"
Print " objeto especifico."
Print "3) Ver todos los objetos."
Print "4) Ver todos los objetos con los objetos"
Print " necesarios para crearlos.
Print "5) Buscar un objeto con los objetos"
Print " necesarios para crearlo."
Print "6) Ver una lista de objetos que se pueden"
Print " crear con uno o mas objetos."
Print "7) Crear vendedor."
Print "8) Añadir objetos a un vendedor."
Print "9) Ver todos los vendedores."
Print "10) Ver los objetos disponibles de todos los vendedores."
Print "11) Ver los objetos disponibles de un vendedor."
Print "12) Buscar que vendedores venden un determinado objeto."
Print "13) Añadir un objeto de cambio a un vendedor."
Print "14) Ver todos los objetos de cambio de cada vendedor."
Print "15) Ver todos los objetos de cambio de un vendedor."
Print "16) Buscar que objeto es cambiado por uno o mas vendedor."
Print "17) Acceder a las opciones de base de datos de usuarios."
Print "18) Salir del programa."
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
Print "Inserte el nombre del nuevo objeto:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "No ha insertado ningun nombre."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
trx#=0
If num_objetos#=0
Dim lista_objetos$(num_objetos#)
Dim lista_creacion_objetos#(num_objetos#,num_objetos#)
lista_objetos$(num_objetos#)=dat$
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Se ha añadido el objeto a la base de datos."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If num_objetos#>0
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
Print "El objeto indicado ya existe."
Print "Inserte el nuevo nombre para el objeto actual:"
Print "(No inserte nada para descartar los datos y"
Print " volver al menu inicial)."
dat$=Input()
If dat$=""
num_objetos#=num_objetos#+1
Goto inicio
EndIf
For txz#=0 To num_objetos#
If dat$=lista_objetos$(txz#)
Cls
Locate 0,0
Print "El nombre indicado no se puede añadir,"
Print "ya esta en uso."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
Goto inicio
EndIf
Next
lista_objetos$(tr#)=dat$
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "El nombre del objeto se ha modificado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Next
Dim lista_objetos_b$(num_objetos#)
Dim lista_creacion_objetos_b#(num_objetos#,num_objetos#)
For tr#=0 To num_objetos#
dat_b$=lista_objetos$(tr#)
lista_objetos_b$(tr#)=dat_b$
For trr#=0 To num_objetos#
dat_b$=lista_creacion_objetos#(tr#,trr#)
lista_creacion_objetos_b#(tr#,trr#)=dat_b$
Next
Next
num_objetos#=num_objetos#+1
Dim lista_objetos$(num_objetos#)
Dim lista_creacion_objetos#(num_objetos#,num_objetos#)
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
dat_b$=lista_objetos_b$(tr#)
lista_objetos$(tr#)=dat_b$
For trr#=0 To num_objetos#
dat_b$=lista_creacion_objetos_b#(tr#,trr#)
lista_creacion_objetos#(tr#,trr#)=dat_b$
Next
Next
If vendedores#>0
vendedores#=vendedores#-1
Dim objetos_vendedores_b#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores_b#(vendedores#,num_objetos#,num_objetos#)
For tr#=0 To vendedores#
For trr#=0 To num_objetos#
opciones#=objetos_vendedores#(tr#,trr#)
objetos_vendedores_b#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
num_objetos#=num_objetos#+1
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
num_objetos#=num_objetos#-1
For tr#=0 To vendedores#
For trr#=0 To num_objetos#
opciones#=objetos_vendedores_b#(tr#,trr#)
objetos_vendedores#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores_b#(tr#,trr#,trrr#)
objetos_cambio_vendedores#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
vendedores#=vendedores#+1
EndIf
num_objetos#=num_objetos#+1
lista_objetos$(num_objetos#)=dat$
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Se ha añadido el objeto a la base de datos."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
EndIf
If opciones#=2
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If num_objetos#<2
Print "Ha creado menos de 2 objeto."
Print "Debe crear 2 o mas antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del objeto principal:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "No ha insertado ningun nombre."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
Print "Se ha encontrado el objeto indicado."
Print "Pulse una tecla para seguir."
Dim lista_objetos_temp#(num_objetos#)
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
lista_objetos_temp#(trn#)=val#
Next
WaitKey()
.add_quit_object
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Ver una lista de todos los objetos."
Print "2) Ver la lista inicial de objetos necesarios para"
Print " poder crear el objeto principal."
Print "3) Ver la lista actual de objetos necesarios para"
Print " poder crear el objeto principal."
Print "4) Modificar la cantidad de un objeto para poder"
Print " crear el objeto principal."
Print "5) Volver al menu inicial descartando los datos.
Print "6) Volver al menu inicial guardando los datos.
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
trx#=0
For trn#=0 To num_objetos#
num_objetosx#=trn#+1
Print "Objeto no. " + num_objetosx#
Print lista_objetos$(trn#)
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto add_quit_object
EndIf
Cls
Locate 0,0
trx#=0
EndIf
Next
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=2
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
If val#>1
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad necesaria de este objeto:"
Print val#
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto add_quit_object
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
EndIf
EndIf
Next
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=3
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
For trn#=0 To num_objetos#
val#=lista_objetos_temp#(trn#)
If val#>0
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad necesaria de este objeto:"
Print val#
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto add_quit_object
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
trx#=0
EndIf
EndIf
Next
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=4
Cls
Locate 0,0
Print "Inserte el nombre del objeto que desea añadir/quitar"
Print "para crear el objeto principal:"
daty$=Input()
For trn#=0 To num_objetos#
If tr#=trn#
Cls
Locate 0,0
Print "Ha insertado un nombre no valido, ya que es"
Print "el nombre del objeto principal."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If daty$=lista_objetos$(trn#)
val#=lista_objetos_temp#(trn#)
.select_add_or_quit
Cls
Locate 0,0
Print "Cantidad del necesaria del objeto indicado"
Print "para crear el objeto principal:" + val#
Print "¿Que cantidad del objeto indicado se necesita
Print " para crear el objeto principal?."
Print "(Inserte un valor menor a 0 para volver al"
Print " menu anterior descartando el cambio actual)."
val#=Input()
Cls
Locate 0,0
If val#<0
Print "Cantidad no modificada."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
lista_objetos_temp#(trn#)=val#
Cls
Locate 0,0
Print "Cantidad modificada."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado el objeto indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto add_quit_object
EndIf
If opciones#=5
.return_without_saving
Cls
Locate 0,0
Print "¿Realmente desea volver al menu inicial guardando los cambios? (S/N)."
dat$=Input()
If dat$="S" Or dat$="s"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
If dat$="N" Or dat$="n"
Goto add_quit_object
EndIf
Goto return_without_saving
EndIf
If opciones#=6
.return_saving
Cls
Locate 0,0
Print "¿Realmente desea volver al menu inicial guardando los cambios? (S/N)."
dat$=Input()
If dat$="S" Or dat$="s"
For trn#=0 To num_objetos#
val#=lista_objetos_temp#(trn#)
lista_creacion_objetos#(tr#,trn#)=val#
Next
Cls
Locate 0,0
Print "Se han aplicado los cambios."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
Goto inicio
EndIf
If dat$="N" Or dat$="n"
Goto add_quit_object
EndIf
Goto return_saving
EndIf
Goto add_quit_object
EndIf
Next
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "No se ha encontrado ningun objeto con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If opciones#=3
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear uno antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
trx#=0
num_objetos#=num_objetos#-1
For trn#=0 To num_objetos#
num_objetosx#=trn#+1
Print "Objeto no. " + num_objetosx#
Print lista_objetos$(trn#)
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Cls
Locate 0,0
trx#=0
EndIf
Next
num_objetos#=num_objetos#+1
Print ""
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If opciones#=4
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear uno antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
trx#=0
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
num_objetosx#=trn#+1
Print "Objeto no. " + num_objetosx#
Print lista_objetos$(tr#)
Print ""
trx#=trx#+1
Print "Objetos necesarios para crear este objeto:"
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
If val#>1
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad de este objeto para crear el objeto principal:"
Print val#
Print ""
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
Cls
Locate 0,0
trx#=0
EndIf
EndIf
Next
Print ""
Print "Inserte R o r para volver al menu anterior y"
Print "dejar de ver mas objetos."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Cls
Locate 0,0
Next
num_objetos#=num_objetos#+1
Print "Ya se han mostrado todos los objetos."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
.seeker_base
If opciones#=5
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear uno antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del objeto a buscar:"
dat$=Input()
Cls
Locate 0,0
If dat$=""
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
For trn#=0 To num_objetos#
val#=lista_creacion_objetos#(tr#,trn#)
If val#>0
num_objetosx#=trn#+1
Print lista_objetos$(trn#)
Print "Cantidad de este objeto para crear el objeto principal:"
Print val#
Print ""
trx#=trx#+1
If trx#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
num_objetos#=num_objetos#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Cls
Locate 0,0
Print "Nombre del objeto principal:"
Print lista_objetos$(tr#)
Print "Objetos necesarios para crear este objeto:"
Cls
Locate 0,0
trx#=0
EndIf
EndIf
Next
Print ""
Print "Ya se ha mostrado el objeto junto a todos"
Print "los objetos necesarios para crearlo."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado ningun objeto con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
num_objetos#=num_objetos#+1
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=6
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If num_objetos#<2
Print "Ha creado menos de 2 objeto."
Print "Debe crear 2 o mas antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
num_objetos#=num_objetos#-1
Dim lista_objetos_c#(num_objetos#)
.obj_base
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Añadir/quitar un objeto base de la lista"
Print " para crear otro objeto.
Print "2) Buscar objetos que se puedan crear con"
Print " todos los objetos indicados."
Print "3) Volver al menu inicial."
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
Print "Inserte el objeto que desea añadir/eliminar"
Print "para crear otro objeto:"
dat$=Input()
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
.i_o_object
Cls
Locate 0,0
If lista_objetos_c#(tr#)=0
Print "¿Realmente desea añadir el objeto indicado de la"
Print " lista para crear otro objeto? (S/N)."
EndIf
If lista_objetos_c#(tr#)=1
Print "¿Realmente desea eliminar el objeto indicado de la"
Print " lista para crear otro objeto? (S/N)."
EndIf
dat$=Input()
If dat$="S" Or dat$="s"
If lista_objetos_c#(tr#)=1
lista_objetos_c#(tr#)=0
Cls
Locate 0,0
Print "Objeto eliminado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_base
EndIf
If lista_objetos_c#(tr#)=0
lista_objetos_c#(tr#)=1
Cls
Locate 0,0
Print "Objeto añadido."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_base
EndIf
EndIf
If dat$="N" Or dat$="n"
Goto obj_base
EndIf
Goto i_o_object
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado el objeto indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_base
EndIf
If opciones#=2
.total_objs
Cls
Locate 0,0
Print "¿Los objetos que se van a mostrar deben incluir"
Print " todos los objetos que se acaban de añadir? (S/N)."
daty$=Input()
vary#=0
var_03#=0
If daty$="S" Or daty$="s"
For tr#=0 To num_objetos#
vary#=0
varz#=0
For trr#=0 To num_objetos#
If lista_objetos_c#(trr#)=1
vary#=vary#+1
EndIf
Next
For trr#=0 To num_objetos#
If lista_objetos_c#(trr#)=1
If lista_creacion_objetos#(tr#,trr#)=1
varz#=varz#+1
EndIf
EndIf
Next
If vary#=varz#
var_03#=1
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
var_02#=0
For trn#=0 To num_objetos#
var_00#=lista_objetos_c#(trn#)
var_01#=lista_creacion_objetos#(tr#,trn#)
If var_01#>0
If var_00#=1
Print lista_objetos$(trn#) + " (Objeto indicado en la busqueda)"
EndIf
If var_00#=0
Print lista_objetos$(trn#) + " (Objeto no indicado en la busqueda)"
EndIf
Print "Cantidad de este objeto para crear el objeto principal:"
Print var_01#
Print ""
EndIf
var_02#=var_02#+1
If var_02#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
var_02#=0
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
EndIf
Next
Print ""
Print "No hay mas datos que mostrar de este objeto."
Print "Inserte R o r para volver al menu anterior, o bien"
Print "otra cosa para seguir."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
EndIf
Next
Goto mensaje_fin_busquedas_0x0
EndIf
If daty$="N" Or daty$="n"
For tr#=0 To num_objetos#
For trr#=0 To num_objetos#
var_00#=lista_objetos_c#(trr#)
var_01#=lista_creacion_objetos#(tr#,trr#)
If var_00#=1
If var_01#>1
var_03#=1
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
var_02#=0
For trn#=0 To num_objetos#
var_00#=lista_objetos_c#(trn#)
var_01#=lista_creacion_objetos#(tr#,trn#)
If var_01#>0
If var_00#=1
Print lista_objetos$(trn#) + " (Objeto indicado en la busqueda)"
EndIf
If var_00#=0
Print lista_objetos$(trn#) + " (Objeto no indicado en la busqueda)"
EndIf
Print "Cantidad de este objeto para crear el objeto principal:"
Print var_01#
Print ""
EndIf
var_02#=var_02#+1
If var_02#=10
Print ""
Print "Inserte R o r para volver al menu anterior."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
var_02#=0
Cls
Locate 0,0
Print "Nombre del objeto encontrado:"
Print ""
Print lista_objetos$(tr#)
Print ""
Print "Lista de objetos necesitados para crear este objeto:"
EndIf
Next
Print ""
Print "No hay mas datos que mostrar de este objeto."
Print "Inserte R o r para volver al menu anterior, o bien"
Print "otra cosa para seguir."
daty$=Input()
If daty$="R" Or daty$="r"
Goto obj_base
EndIf
Goto obj_base_nn
EndIf
EndIf
Next
.obj_base_nn
Next
.mensaje_fin_busquedas_0x0
If var_03#=1
Cls
Locate 0,0
Print "Ya se han mostrado todos los objetos que se"
Print "pueden crear con los objetos indicados."
Print "Pulse una tecla para volver al menu anterior."
EndIf
If var_03#=0
Print "No se puede crear ningun objeto con los que"
Print "se han indicado."
Print "Pulse una tecla para volver al menu anterior."
EndIf
WaitKey()
Goto obj_base
EndIf
Goto total_objs
EndIf
If opciones#=3
.return_op_05
Cls
Locate 0,0
If seeker_database#=1
Print "¿Realmente desea volver al menu anterior? (S/N)."
EndIf
If seeker_database#=0
Print "¿Realmente desea volver al menu inicial? (S/N)."
EndIf
dat$=Input()
If dat$="S" Or dat$="s"
num_objetos#=num_objetos#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If dat$="N" Or dat$="n"
Goto obj_base
EndIf
Goto return_op_05
EndIf
Goto obj_base
EndIf
If opciones#=7
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del nuevo vendedor:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
num_objetos#=num_objetos#-1
Dim listas_vendedores$(vendedores#)
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
listas_vendedores$(vendedores#)=dat$
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Vendedor creado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If vendedores#>0
vendedores#=vendedores#-1
For tr#=0 To vendedores#
If dat$=listas_vendedores$(tr#)
Cls
Locate 0,0
Print "Ya existe un vendedor con el nombre indicado."
Print "Inserte el nuevo nombre para este vendedor:"
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "Ha insertado un nombre no valido."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
For trr#=0 To vendedores#
If dat$=listas_vendedores$(trr#)
Cls
Locate 0,0
vendedores#=vendedores#+1
Print "El nombre indicado ya esta en uso."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Next
vendedores#=vendedores#+1
listas_vendedores$(tr#)=dat$
Cls
Locate 0,0
Print "Se ha modificado el nombre del vendedor."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Next
num_objetos#=num_objetos#-1
Dim listas_vendedores_b$(vendedores#)
Dim objetos_vendedores_b#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores_b#(vendedores#,num_objetos#,num_objetos#)
For tr#=0 To vendedores#
dat_b$=listas_vendedores$(tr#)
listas_vendedores_b$(tr#)=dat_b$
For trr#=0 To num_objetos#
opciones#=objetos_vendedores#(tr#,trr#)
objetos_vendedores_b#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
vendedores#=vendedores#+1
Dim listas_vendedores$(vendedores#)
Dim objetos_vendedores#(vendedores#,num_objetos#)
Dim objetos_cambio_vendedores#(vendedores#,num_objetos#,num_objetos#)
vendedores#=vendedores#-1
For tr#=0 To vendedores#
dat_b$=listas_vendedores_b$(tr#)
listas_vendedores$(tr#)=dat_b$
For trr#=0 To num_objetos#
opciones#=objetos_vendedores_b#(tr#,trr#)
objetos_vendedores#(tr#,trr#)=opciones#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(tr#,trr#,trrr#)=opciones#
Next
Next
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
listas_vendedores$(vendedores#)=dat$
vendedores#=vendedores#+1
Cls
Locate 0,0
Print "Se ha creado un vendedor con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
EndIf
If opciones#=8
Cls
Locate 0,0
Print "Inserte el nombre del vendedor para incluir"
Print "los objetos que vende:"
dat$=Input()
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
For tr#=0 To vendedores#
Dim objetos_vendedores_b#(0,num_objetos#)
For trr#=0 To num_objetos#
opciones#=objetos_vendedores#(tr#,trr#)
objetos_vendedores_b#(0,trr#)=opciones#
Next
If dat$=listas_vendedores$(tr#)
.incluir_obj_vendedor
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Ver la lista inicial de objetos incluidos."
Print "2) Ver la lista actual de objetos incluidos."
Print "3) Añadir/quitar un objeto a este vendedor."
Print "4) Volver al menu inicial aplicando los cambios."
Print "5) Volver al menu inicial descartando los cambios."
opciones#=Input()
If opciones#=1
trr#=0
Cls
Locate 0,0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores#(tr#,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " :" + opciones#
EndIf
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
If dat$="R" Or dat$="r"
Goto incluir_obj_vendedor
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
Next
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto incluir_obj_vendedor
EndIf
If opciones#=2
trr#=0
Cls
Locate 0,0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores_b#(0,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " :" + opciones#
EndIf
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
If dat$="R" Or dat$="r"
Goto incluir_obj_vendedor
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
Next
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto incluir_obj_vendedor
EndIf
If opciones#=3
Cls
Locate 0,0
Print "Inserte el nombre del objeto que desea"
Print "añadir/eliminar al vendedor actual:"
dat$=Input()
For trr#=0 To num_objetos#
If dat$=lista_objetos$(trr#)
Cls
Locate 0,0
opciones#=objetos_vendedores_b#(0,trr#)
Print "Nombre del objeto: " + dat$
Print "Precio del objeto: " + objetos_vendedores_b#(0,trr#)
Print ""
Print "Inserte el nuevo precio del objeto:"
Print "(Inserte 0 para eliminar el objeto de la"
Print " lista del vendedor)."
Print "(Inserte un valor menor a 0 para no"
Print " realizar ningun cambio)."
opciones#=Input()
If opciones#<0
Print ""
Print "No se a aplicado el cambio."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto incluir_obj_vendedor
EndIf
objetos_vendedores_b#(0,trr#)=opciones#
Print ""
Print "Se a aplicado el cambio."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto incluir_obj_vendedor
EndIf
Next
Cls
Locate 0,0
Print "No se ha encontrado ningun objeto con el nombre indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto incluir_obj_vendedor
EndIf
If opciones#=4
.vuelta_menu_ant_0000
Cls
Locate 0,0
Print "¿Realmente desea volver al menu anterior"
Print " aplicando todos los cambios? (S/N)."
dat$=Input()
If dat$="N" Or dat$="n"
Goto incluir_obj_vendedor
EndIf
If dat$="S" Or dat$="s"
For trr#=0 To num_objetos#
opciones#=objetos_vendedores_b#(0,trr#)
objetos_vendedores#(tr#,trr#)=opciones#
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "Se han aplicado los cambios."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
Goto vuelta_menu_ant_0000
EndIf
If opciones#=5
.vuelta_menu_ant_0011
Cls
Locate 0,0
Print "¿Realmente desea volver al menu anterior"
Print " descartando todos los cambios? (S/N)."
dat$=Input()
If dat$="N" Or dat$="n"
Goto incluir_obj_vendedor
EndIf
If dat$="S" Or dat$="s"
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Goto inicio
EndIf
Goto vuelta_menu_ant_0011
EndIf
Goto incluir_obj_vendedor
EndIf
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "No existe ningun vendedor con el nombre indicado."
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto inicio
EndIf
If opciones#=9
Cls
Locate 0,0
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
trx#=0
vendedores#=vendedores#-1
For tr#=0 To vendedores#
trr#=tr#+1
Print "Vendedor no. " + trr# + ": "
Print listas_vendedores$(tr#)
trx#=trx#+1
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu inicial."
dat$=Input()
Cls
Locate 0,0
If dat$="R" Or dat$="r"
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
EndIf
Next
vendedores#=vendedores#+1
Print "No hay mas vendedores a mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=10
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear almenos 1 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
num_objetos#=num_objetos#-1
vendedores#=vendedores#-1
For tr#=0 To vendedores#
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores#(tr#,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " : " + opciones#
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
Cls
Locate 0,0
If dat$="R" Or dat$="r"
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
EndIf
Next
Print ""
Print "Se han monstrado todos los objetos que"
Print "ofrece este vendedor."
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
Cls
Locate 0,0
If dat$="R" Or dat$="r"
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=11
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear almenos 1 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
trx#=0
Print "Indique el nombre del vendedor para ver los"
Print "objetos que vende:"
Print "(No inserte nada para ver los objetos que"
Print " tienen disponibles todos los vendedores)."
dat$=Input()
If dat$=""
Cls
Locate 0,0
Print "No ha insertado ningun nombre/valor."
Print "Debe insertar almenos uno para acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
For tr#=0 To vendedores#
If dat$=listas_vendedores$(tr#)
Cls
Locate 0,0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
For trr#=0 To num_objetos#
trx#=trx#+1
opciones#=objetos_vendedores#(tr#,trr#)
If opciones#>0
Print lista_objetos$(trr#) + " :" + opciones#
EndIf
If trx#=10
trx#=0
Print ""
Print "Inserte R o r para volver al menu incial."
dat$=Input()
If dat$="R" Or dat$="r"
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print ""
Print "Objetos disponibles / precio:"
EndIf
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
Print "Ya no hay mas datos que mostrar."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Next
num_objetos#=num_objetos#+1
vendedores#=vendedores#+1
Cls
Locate 0,0
Print "No se ha encontrado ningun vendedor con el nombre indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If opciones#=12
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear almenos 1 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Cls
Locate 0,0
Print "Indique el objeto en cuestion:"
dat$=Input()
vendedores#=vendedores#-1
num_objetos#=num_objetos#-1
For tr#=0 To num_objetos#
If dat$=lista_objetos$(tr#)
Cls
Locate 0,0
tx#=0
Print "Nombre del objeto:"
Print lista_objetos$(tr#)
Print ""
Print "Nombre del vendedor que dispone del objeto indicado/precio del objeto:
For trr#=0 To vendedores#
opciones#=objetos_vendedores#(trr#,tr#)
If opciones#>0
Print listas_vendedores$(trr#) + " / " + objetos_vendedores#(trr#,tr#)
tx#=tx#+1
If tx#=10
Print ""
Print "Inserte R o r para volver al menu inicial."
dat$=Input()
If dat$="R" Or dat$="r"
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Cls
Locate 0,0
tx#=0
Print "Nombre del objeto:"
Print lista_objetos$(tr#)
Print ""
Print "Nombre del vendedor que dispone del objeto indicado/precio del objeto:
EndIf
EndIf
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Print "No hay mas vendedores que vendan el objeto indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
Next
vendedores#=vendedores#+1
num_objetos#=num_objetos#+1
Cls
Locate 0,0
Print "No se ha encontrado el objeto indicado."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
If seeker_database#=1
Goto database_users
EndIf
Goto inicio
EndIf
If seeker_database#=1
Goto database_users
EndIf
If opciones#=13
Cls
Locate 0,0
If num_objetos#=0
Print "No ha creado ningun objeto."
Print "Debe crear 2 objetos antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
If vendedores#=0
Print "No ha creado ningun vendedor."
Print "Debe crear almenos 1 antes de acceder a esta opcion."
Print "Pulse una tecla para volver al menu inicial."
WaitKey()
Goto inicio
EndIf
Print "Inserte el nombre del vendedor para"
Print "añadirle objetos de cambio:"
dat$=Input()
num_objetos#=num_objetos#-1
vendedores#=vendedores#-1
For tr#=0 To vendedores#
If dat$=listas_vendedores$(tr#)
Dim objetos_cambio_vendedores_b#(0,num_objetos#,num_objetos#)
For trr#=0 To num_objetos#
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
objetos_cambio_vendedores_b#(0,trr#,trrr#)=opciones#
Next
Next
.obj_cambios_vendedores
Cls
Locate 0,0
Print "Que desea hacer?."
Print "1) Ver la lista inicial de objetos que cambia el vendedor actual."
Print "2) Ver la lista actual de objetos que cambia el vendedor actual."
Print "3) Añadir/quitar un objeto de la lista del vendedor."
Print "4) Volver al menu anterior descartando los cambios."
Print "5) Volver al menu anterior aplicando los cambios."
opciones#=Input()
If opciones#=1
trnn#=0
For trr#=0 To num_objetos#
For trrr#=0 To num_objetos#
If trrr#=trr#
Goto next_obj_de_cambio_vendedor_001yy
EndIf
opciones#=objetos_cambio_vendedores#(tr#,trr#,trrr#)
If opciones#>0
trn#=0
trnn#=1
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
Print "Nombre de los objetos que requiere y su cantidad:"
Print ""
For trx#=0 To num_objetos#
If trx#=trr#
Goto next_obj_de_cambio_vendedor_001yy01
EndIf
opciones#=objetos_cambio_vendedores#(tr#,trr#,trx#)
If opciones#>0
Print lista_objetos$(trx#) + " : " + opciones#
Print ""
trn#=trn#+1
If trn#=7
Print ""
Print "Inserte R o r para volver al menu anterior."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
EndIf
EndIf
.next_obj_de_cambio_vendedor_001yy01
Next
Print "Inserte R o r para volver al menu anterior y"
Print "dejar de ver los objetos que cambia este vendedor."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Goto next_obj_de_cambio_vendedor
EndIf
.next_obj_de_cambio_vendedor_001yy
Next
.next_obj_de_cambio_vendedor
Next
Cls
Locate 0,0
If trnn#=0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia ningun objeto."
EndIf
If trnn#=1
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia mas objetos."
EndIf
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_cambios_vendedores
EndIf
If opciones#=2
trnn#=0
For trr#=0 To num_objetos#
For trrr#=0 To num_objetos#
If trrr#=trr#
Goto next_obj_de_cambio_vendedor_001xx
EndIf
opciones#=objetos_cambio_vendedores_b#(0,trr#,trrr#)
If opciones#>0
trn#=0
trnn#=1
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
Print "Nombre de los objetos que requiere y su cantidad:"
Print ""
For trx#=0 To num_objetos#
If trx#=trr#
Goto next_obj_de_cambio_vendedor_001yy02
EndIf
opciones#=objetos_cambio_vendedores_b#(0,trr#,trx#)
If opciones#>0
Print lista_objetos$(trx#) + " : " + opciones#
Print ""
trn#=trn#+1
If trn#=7
Print ""
Print "Inserte R o r para volver al menu anterior."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Cls
Locate 0,0
Print "Nombre del objeto que ofrece el vendedor:"
Print lista_objetos$(trr#)
Print ""
EndIf
EndIf
.next_obj_de_cambio_vendedor_001yy02
Next
Print "Inserte R o r para volver al menu anterior y"
Print "dejar de ver los objetos que cambia este vendedor."
trn#=0
dat$=Input()
If dat$="R" Or dat$="r"
Goto obj_cambios_vendedores
EndIf
Goto next_obj_de_cambio_vendedor_001
EndIf
.next_obj_de_cambio_vendedor_001xx
Next
.next_obj_de_cambio_vendedor_001
Next
Cls
Locate 0,0
If trnn#=0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia ningun objeto."
EndIf
If trnn#=1
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia por mas objetos."
EndIf
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto obj_cambios_vendedores
EndIf
If opciones#=3
Cls
Locate 0,0
Print "Indique el objeto que desea añadir al vendedor actual:"
dat$=Input()
For trr#=0 To num_objetos#
If dat$=lista_objetos$(trr#)
Dim object_required_changes#(num_objetos#)
For trrr#=0 To num_objetos#
opciones#=objetos_cambio_vendedores_b#(0,trr#,trrr#)
object_required_changes#(trrr#)=opciones#
Next
.opcs_cambio_obj_vendedor
Cls
Locate 0,0
Print "¿Que desea hacer?."
Print "1) Ver la lista actual de objetos que requiere el vendedor."
Print "2) Modificar la cantidad que el vendedor requiere de un objeto."
Print "3) Modificar las unidades que se ofrece del objeto actual."
Print "4) Eliminar este objeto de la lista de cambios del vendedor"
Print " y volver al menu anterior."
Print "5) Volver al menu anterior descartando los cambios."
Print "6) Volver al menu anterior aplicando los cambios."
opciones#=Input()
If opciones#=1
Cls
Locate 0,0
trn#=0
trnn#=0
Print "Lista de objetos requeridos para el cambio:"
Print "(Nombre/cantidad del objeto)."
Print ""
For trrr#=0 To num_objetos#
If trrr#=trr#
Goto saltos_999999
EndIf
opciones#=object_required_changes#(trrr#)
If opciones#>0
trnn#=1
trn#=trn#+1
Print lista_objetos$(trrr#) + " :" + opciones#
If trn#=7
trn#=0
Print "Inserte R o r para volver al menu anterior."
dat$=Input()
If dat$="R" Or dat$="r"
Goto opcs_cambio_obj_vendedor
EndIf
Cls
Locate 0,0
Print "Lista de objetos requeridos para el cambio:"
Print "(Nombre/cantidad del objeto)."
Print ""
EndIf
EndIf
.saltos_999999
Next
If trnn#=0
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia ningun objeto."
EndIf
If trnn#=1
Print "Nombre del vendedor:"
Print listas_vendedores$(tr#)
Print "Este vendedor no cambia por mas objetos."
EndIf
Print "Pulse una tecla para volver al menu anterior."
WaitKey()
Goto opcs_cambio_obj_vendedor
EndIf
If opciones#=2
Cls
Locate 0,0
Print "Inserte el nombre del objeto requerido:"
dat$=Input()
For trrr#=0 To num_objetos#
If dat$=lista_objetos$(trrr#)
If trr#=trrr#
Print "No se puede acceder a esta opcion."
Print "El objeto que ha indicado es el mismo que"
Print "el vendedor ofrece."
Print "Pulse una tecla para volver almenu anterior."
WaitKey()
Goto opcs_cambio_obj_vendedor
EndIf
Cls
Locate 0,0
Print "Nombre del objeto requerido:"
Print lista_objetos$(trrr#)
Print ""
Print "Cantidad requerida de este objeto:"
Print object_required_changes#(trrr#)
Print ""
Print "Inserte la nueva cantidad requerida de este objeto:"
Print "(Inserte 0 para que este objeto no sea necesario"
Print " para realizar el cambio)."
Print "(Inserte un valor menor a 0 para no aplicar ningun"
Print " cambio a este objeto)."
opciones#=Input()
If opciones#<0