El programa se llama cbmHandBasic, pero este codigo puede ser ejecutado en cualquier intérprete Basic. Ayuda en algunos cálculos para efectuar balance hídrico. El apartado "Cálculo de dosis" aún no está operativo.
0 T$ = "HEALTHCALC v1.0"
1 REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> GLOBAL
2 SEP$="================================================"
3 SP$="------------------------------------------------"
4 SB$="= ="
5 DL = 1
50 REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CONFIG
51 MT%=0
99 CLS
100 REM >>>>>>>>>>>>>>>>>>>>>>>>>> PROGRAM START
120 GOSUB 10200
140 PRINT "======== Calculadora y ayuda de bolsillo ======="
150 REM >>>>>>>>>>>>>>>>>>>>>>>>> MENU PRINCIPAL
160 BM$="MENU PRINCIPAL"
165 DL=0
170 GOSUB 10100
180 REM """"""""""""""""""""""""""""""""""""""""
190 PRINT "BALANCE HÕDRICO"
200 PRINT "> Calc. (P)Èrdidas insensibles y agua endogena"
205 PRINT "> (V)ol˙menes en balance hÌdrico"
230 PRINT SP$
240 PRINT "FLEBOTERAPIA"
250 PRINT "> C·lculo (D)osis)
495 PRINT SP$
497 PRINT "> (X)Salir"
500 REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SELECTOR
510 PRINT SEP$
530 INPUT "Ingrese opciÛn:";OP$
540 IF OP$ = "p" GOTO 1000
550 IF OP$ = "v" GOTO 1300
990 IF OP$ = "x" GOTO 20000
991 CLS
995 PRINT "Ingrese una de las letras entre parÈntesis"
999 GOTO 150
1000 REM """""""""""""CALCULO PERDIDAS""""""""""
1005 GOSUB 10200
1010 BM$="C·lculo pÈrdidas insensibles"
1020 DL=0
1030 GOSUB 10100
1032 INPUT "Ingrese hora llegada (1-23; 0 para omitir)";HR%
1034 MD=1
1035 IF HR%=0 THEN MD=0: GOTO 1140
1040 IF HR% < 7 GOTO 1070
1050 IF HR% > 20 GOTO 1090
1052 MD$="Turno dÌa"
1054 HS%=20 - HR%
1056 GOTO 1140
1070 REM >>>>>>
1072 HS%=8 - HR%
1074 GOTO 1100
1090 REM <<<<<<
1092 HS%=24 - HR% + 8
1100 MD$="Turno noche"
1140 INPUT "Ingrese kilos de peso";KG%
1155 REM PT=PERDIDA TOTAL, PP= PERDIDA PARCIAL
1160 PT%=KG%*6
1170 PP%=PT%/12 * HS%
1200 PRINT SP$
1205 IF MD=0 GOTO 1240
1210 PRINT MD$
1220 PRINT "En" ; HS% ; "horas:"
1230 PRINT PP% ; "cc"
1232 PRINT " Agua endÛgena:" ; 150/12*HS% ; "cc"
1235 PRINT SP$
1237 PRINT "En 12 horas:"
1240 PRINT PT% ; "cc"
1247 PRINT " Agua endÛgena: 150 cc"
1250 GOSUB 10300
1260 GOTO 1000
1300 REM """"""""""VOLUMENES BALANCE""""""""""""
1305 GOSUB 10200
1310 BM$="Vol˙menes en Balance HÌdrico"
1320 DL=0
1330 GOSUB 10100
1340 PRINT "> (G)lÛbulos rojos"
1350 PRINT "> (D)eposiciones"
1360 PRINT "> (I)ngesta alimentaria"
1370 PRINT "> (R)espiraciÛn"
1380 PRINT "> (F)iebre"
1390 PRINT SEP$
1396 PRINT "> (M)en˙ principal"
1398 PRINT "> (X)Salir"
1399 PRINT SEP$
1400 INPUT "Ingrese opciÛn";OP$
1405 IF OP$="x" GOTO 20000
1410 IF OP$="g" GOTO 1500
1495 CLS
1496 PRINT "Ingrese una opciÛn entre parÈntesis"
1497 GOTO 1300
1500 REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>> >G. ROJOS
9999 GOTO 20000
10000 REM >>>>>>>>>>>>>>>>>>>>>>>>>>> SUBRUTINAS
10005 GOSUB 10200
10010 BM$="C·lculo pÈrdidas insensibles"
10020 DL=0
10030 GOSUB 10100
10100 REM """"""""""""SUB (MAKE BOX)""""""""""""
10115 IF DL=1 THEN PRINT SEP$
10117 IF DL=0 THEN PRINT SP$
10119 BS%=0
10121 BS$=""
10122 BS%=25 - (LEN(BM$)/2)
10123 FOR I=1 TO BS% STEP 1
10124 BS$=BS$+" "
10130 NEXT
10140 PRINT BS$ + BM$
10145 IF DL=1 THEN PRINT SEP$
10147 IF DL=0 THEN PRINT SP$
10160 RETURN
10200 REM """""""""""""SUB (PRINT TITLE)""""""""
10205 CLS
10210 BM$=T$
10220 DL=1
10230 GOSUB 10100
10240 RETURN
10300 REM """""""""""""SUB (RETURN DIALOG)""""""
10310 PRINT SEP$
10320 PRINT "(O)tra vez (M)en˙ (X)Salir"
10330 INPUT OP$
10340 IF OP$="m" THEN GOTO 99
10350 IF OP$="x" THEN GOTO 20000
10360 IF OP$="o" THEN GOTO 10400
10365 PRINT SP$
10370 PRINT "Ingrese una opciÛn v·lida"
10380 GOTO 10320
10400 RETURN
20000 REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
20001 CLS
20010 BM$="Hasta pronto! - Marcelo Mendoza - 2014"
20020 DL=1
20030 GOSUB 10100
20050 END
No hay comentarios:
Publicar un comentario