... 0340 LET a$=CTRL(1,101,1),radio=DEC(CTRL(1,101,2)); PRINT a$,radio
0350 PRINT (1)'LISTUNSEL'(102,-1); GOTO main_loop
0360 REM
0370 REM "Ctrl actividad en lista de la derecha (ID=102)
0380 IF e.id<>102 THEN GOTO main_loop
0390 LET a$=CTRL(1,102,1),radio=DEC(CTRL(1,102,2)); PRINT a$,radio
0400 PRINT (1)'LISTUNSEL'(101,-1); GOTO main_loop
0410 REM
0420 pasar:
0430 LET ven=101
0440 LET ven$=CTRL(1,ven,2); IF ven$="" THEN IF ven=101 THEN LETven=ven+1;
GOTO
0440:0440 ELSE GOTO main_loop
0450 LET a$=CTRL(1,ven,3); PRINT (1)'LISTADD'(203-ven,-1,DEC(a$(1,2))),CTRL(1,ven,1)
0460 FOR a=LEN(ven$)-1 TO 1 STEP -2
0470 PRINT (1)'LISTDEL'(ven,DEC(ven$(a,2)))
0480 NEXT a
0490 GOTO main_loop
El último ejemplo de esta
sección nos vuelve a mostrar los mismos tres contextos del programa anterior,
con la diferencia de que ahora permitirá hacer el trasiego de nombres dentro
del mismo contexto, o bien, desde un determinado contexto hacia cualquiera de
los demás.
0001 REM "Ejerc8c Practica controlando tres contextos
0010 OPEN (1)"X0"
0020 PRINT (1)'SEMICHARS'
0030 FOR ven=0 TO 2
0040 IF ven=0 THEN PRINT (1)'WINDOW'(90,32,190,110,"Cantantes",$03$,$FFFFFEFF$
0040:)
0050 IF ven=1 THEN PRINT (1)'CONTEXT'(1),'WINDOW'(5,160,190,110,"Futbolistas",
0050:$03$,$FFFFFEFF$)
0060 IF ven=2 THEN PRINT (1)'CONTEXT'(2),'WINDOW'(202,160,190,110,"Ocupaciones
0060:",$03$,$FFFFFEFF$)
0070 REM
0080 PRINT (1)'BUTTON'(1,82,90,25,15,"Pasar",$$)
0090 PRINT (1)'LISTBOX'(101,10,10,80,80,"",$0400$)
0100 PRINT (1)'LISTBOX'(102,100,10,80,80,"",$0400$)
0110 REM
0120 ON ven GOTO cant,futb,ocup
0122 REM
0128 cant:
0130 PRINT (1)'LISTADD'(101,-1,"John","Paul","George","Ringo","Madonna","M.Jac
0130:kson","Sting","Pink Floyd","Aaaaa","Bbbbbb","Cccccc","Dddddd")
0140 PRINT (1)'LISTADD'(102,-1,"Maria","Jose","Miguel","Angel","Pablo")
0145 GOTO 0240
0150 REM
0160 futb:
0170 PRINT (1)'LISTADD'(101,-1,"Pele","Maradona","El
Kaiser","Luis Garcia","Re
0170:inaldo","Teofilo Cubillas")
0180 PRINT (1)'LISTADD'(102,-1,"Gabelo","Ronald Gomez","Wilmer
Lopez","Maurici
0180:o Montero","Rolando Fonseca")
0190 GOTO 0240
0200 REM
0210 ocup:
0220 PRINT (1)'LISTADD'(101,-1,"Mecanico","Bombero","Fontanero","Cirujano","Ab
0220:ogado","Chofer","Guarda")
0230 PRINT (1)'LISTADD'(102,-1,"Secretaria","Doctora","Miscelanea","Misionera"
0230:,"Visitadora Social","Maestra","Microbiologa","Supervisora")
0240 NEXT ven
0250 REM
0260 main_loop: DIM e$:TMPL(1)
0270 READ RECORD(1,SIZ=LEN(e$))e$
0280 PRINT e.context," ",e.code$,e.id," ",HTA(BIN(e.flags,1)),e.x,e.y
0290 IF e.code$="X" THEN PRINT (1)'DESTROY'; STOP
0295 LET context_act=e.context; PRINT (1)'CONTEXT'(e.context) ...
|