newTIboyRob Posted September 30, 2023 Share Posted September 30, 2023 (edited) So from the TI Basic manual, I see this is the command to clear the screen. It does this, but as we know, creating an effect as if seeing the info just being pushed up from the bottom to the top of the screen. Is there a CHR$ command or other way so it will first clear the screen but then list data from top to bottom? Edited September 30, 2023 by newTIboyRob Quote Link to comment Share on other sites More sharing options...
+mizapf Posted September 30, 2023 Share Posted September 30, 2023 This is not the way how printing on the screen works in TI BASIC. PRINT always adds the text into the last line and scrolls it afterwards. Only Extended Basic has a DISPLAY AT which allows you to output at any screen location. CALL CLEAR really clears the screen by filling it with spaces, but that does not mean that printing starts at the top afterwards. As I said, unlike e.g. Commodore computers, TI BASIC has no cursor that can be positioned. If you want to do some output at any screen location, you may have to write all characters one-by-one with CALL HCHAR. Or use Extended Basic, of course. 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted September 30, 2023 Share Posted September 30, 2023 28 minutes ago, newTIboyRob said: So from the TI Basic manual, I see this is the command to clear the screen. It does this, but as we know, the info is just pushed up from the bottom to the top of the screen. Is there a CHR$ command or other way so it will first clear the screen but then list data from top to bottom? CALL CLEAR in TI Basic and Extended Basic use a GPL Command ALL >80 which is space character and a offset per memory of 90 added to it. This GPL Command clears the screen by using the character you tell it to use+offset. The top left character is replaced and it works to the right 32 characters then drops down one line each time till reaching last of screen. CALL CLEAR does not scroll up the screen after the command ALL >80 Quote Link to comment Share on other sites More sharing options...
newTIboyRob Posted September 30, 2023 Author Share Posted September 30, 2023 So @mizapf... in Extended Basic , you mean to say that if you type in a program and when it is run you wish it to perform from top to bottom, say like this simple list of 3 printed lines of output: Bananas Grapes Watermelon that each one of those line numbers would require a DISPLAY AT command so as to pinpoint exact screen locations, because the TI will not be able to just clear the screen, start at the top and then just list those 3 items straight down as many computers do, correct? Quote Link to comment Share on other sites More sharing options...
WhataKowinkydink Posted September 30, 2023 Share Posted September 30, 2023 Not really needed to use separate DISPLAYS 100 DISPLAY AT(X,Y):"BANANAS"::"GRAPES"::"WATERMELONS" 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted September 30, 2023 Share Posted September 30, 2023 Yea it gets even more complicated than that if want each of these to be centered in screen also the above will crash. 90 X=5 :: Y=9 100 DISPLAY AT(X,Y):"BANANAS":TAB(Y);"GRAPES":TAB(Y);"WATERMELONS" TAB tell it advance over Y number of columns, otherwise it would start at first column. 1 1 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted September 30, 2023 Share Posted September 30, 2023 You must separate subsequent colons by a space, or they will be interpreted as statement separators. DISPLAY AT(4,5):"BANANAS": :"GRAPES": :"WATERMELONS" And this will not print all three below each other, but, as Rich said, the GRAPES and WATERMELONS print at column 1. Extended Basic offers a USING clause for formatted output, though. Also, you don't need a CALL CLEAR with DISPLAY AT, just add the ERASE ALL option to DISPLAY. 1 1 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted September 30, 2023 Share Posted September 30, 2023 3 hours ago, newTIboyRob said: ...or other way so it will first clear the screen but then list data from top to bottom? Spoiler 4200 REM MESSAGE ROUTINE 1** 4210 FOR N=1 TO LEN(S$) 4220 CALL HCHAR(ROW,COL+N,ASC(SEG$(S$,N,28))) 4230 NEXT N 4240 RETURN ---------------------------------------------------------------------------------------------------------------------------------------- 100 REM PROGRAM:MARKET 110 REM AUTHOR:JOHN PLASTER 120 REM TEXAS INSTRUMENTS 7/21/80 130 CALL CLEAR 140 RANDOMIZE 150 OPTION BASE 1 160 DIM C(2),I(2),T(2),A(2),L(2),D(2),P(2),V(2),W(2),B(2),E(5) 170 DEF FNR(X)=.01*INT(100*X+.5) 180 DATA 50,2,.001,.15,5000,5000,100,100,250,20,.15,.2,.4,.4,12000,1.5 190 DATA MARKET IS A GAME THAT,SIMULATES THE COMPETITION,BETWEEN 2 COMPANIES.," ",EACH COMPANY PRODUCES 200 DATA A PRODUCT DIFFERENTIATED,ONLY BY ADVERTISING.," ","DURING EACH ROUND, BOTH",PLAYERS INPUT A PRODUCTION 210 DATA "QUANTITY, AN ADVERTISING","BUDGET, AND A SELLING PRICE",FOR THE PRODUCT.," ",THE GAME ENDS WHEN ONE 220 DATA COMPANY IS BANKRUPT OR 230 DATA COMPANY 1 ENTER:,PREVIOUS,CASH ON HAND?,PREVIOUS,INVENTORY?,VARIABLE,PRODUCTION COST?,QUARTER NUMBER? 240 DATA " COMPANY 1 COMPANY 2",PRD LEV? PRD LEV? 250 DATA ADV BUD? ADV BUD?,UNI PRI? UNI PRI? 260 DATA " QUARTER",PROF M% CASH SOLD INV ASSET 270 DATA NO PRODUCTION POSSIBLE,BECAUSE OF STRIKE. 280 DATA YOU MAY NOT RAISE PRICES,DURING THE WAGE-PRICE,FREEZE. 290 DATA NEW LABOR CONTRACT.,VARIABLE PRODUCTION COST 300 DATA THE PRESIDENT HAS JUST,IMPOSED A WAGE-PRICE FREEZE,ON THE ECONOMY AND YOU MAY 310 DATA NOT RAISE THE PRICE OF,YOUR PRODUCT OVER THE NEXT,2 QUARTERS. 320 DATA VICTIM OF EMBEZZLEMENT,BY THE VICE PRESIDENT OF,THE COMPANY. YOUR CASH ON 330 DATA DAMAGE IN ITS WAREHOUSE.,ALL UNITS WERE DESTROYED.,YOUR INSURANCE WILL REIM-,BURSE YOU FOR THESE UNITS 340 DATA A TRANSPORTATION STRIKE HAS,OCCURRED AND YOU ARE UNABLE,TO MOVE YOUR GOODS TO THE 350 DATA DISTRIBUTORS. NEGOTIATIONS,HAVE BEGUN BUT HOPE OF A,SETTLEMENT LOOKS DIM. 360 DATA THERE HAS BEEN A STRIKE,AND YOUR PRODUCTION HAS,BEEN HALTED. NEGOTIATIONS,HAVE BEEN STARTED BUT HOPE 370 DATA OF A SETTLEMENT LOOKS DIM. 380 DATA THE WAGE-PRICE FREEZE,HAS ENDED. 390 DATA THE TRANSPORTATION STRIKE,HAS BEEN SETTLED. NORMAL,DELIVERIES WILL RESUME. 400 DATA STRIKE SETTLED. NORMAL,PRODUCTION RESUMED.,NEW VARIABLE COST = 410 DATA INCREASED WAGES. 420 FOR N=1 TO 8 430 CALL COLOR(N,2,8) 440 NEXT N 450 CALL COLOR(9,2,5) 460 CALL CHAR(96,"0") 470 CALL CHAR(91,"C0C0C0C0C0C0C0C0") 480 CALL CHAR(92,"0303030303030303") 490 CALL CHAR(93,"000000000000FFFF") 500 CALL CHAR(94,"FFFF") 510 CALL CHAR(34,"0000000000000303") 520 CALL CHAR(35,"000000000000C0C") 530 CALL CHAR(59,"0303") 540 CALL CHAR(60,"C0C") 550 CALL CHAR(38,"3C4299A1A199423C") 560 REM TITLE SCREEN*** 570 GOSUB 4480 580 PRINT " MARKET SIMULATION": :" COPYRIGHT ";CHR$(38);" 1980": :" TEXAS INSTRUMENTS": : : : : : : : : :" PRESS ANY KEY" 590 CALL KEY(0,KEY,ST) 600 IF ST<=0 THEN 590 610 READ K2,N,K,K3,C(1),C(2),I(1),I(2),F,U,R,G1,G2,G3,M1,K4 620 FLAG$="0" 630 FOR J=1 TO 2 640 A(J)=0 650 L(J)=0 660 P(J)=0 670 NEXT J 680 IF KEY=89 THEN 740 690 REM LIST INSTRUCTIONS** 700 GOSUB 4360 710 REM DETERMINE IF NEW OR OLD GAME** 720 PRINT " 1. NEW GAME":" 2. CONTINUE OLD GAME": : : : : : : : : : : : : : : : : : : : 730 REM BEGIN GAME*** 740 Q=0 750 W2=0 760 W4=0 770 W3=0 780 IF KEY=89 THEN 1240 790 GOSUB 5450 800 IF KEY-48=1 THEN 1240 810 IF KEY-48=2 THEN 830 820 GOTO 790 830 REM OLD GAME*** 840 GOSUB 4480 850 RESTORE 230 860 ROW=3 870 COL=3 880 GOSUB 4250 890 ROW=ROW+2 900 COL=4 910 GOSUB 4250 920 ROW=ROW+1 930 GOSUB 4250 940 ROW=ROW+2 950 GOSUB 4250 960 ROW=ROW+1 970 GOSUB 4250 980 BEG=21 990 IND=29 1000 FOR J=1 TO 2 1010 CALL HCHAR(3,12,48+J) 1020 CALL HCHAR(6,21,32,10) 1030 CALL HCHAR(9,21,32,10) 1040 ROW=6 1050 GOSUB 4540 1060 C(J)=VAL(S$) 1070 IF C(J)>=M1 THEN 1050 1080 ROW=9 1090 GOSUB 4540 1100 I(J)=VAL(S$) 1110 NEXT J 1120 ROW=ROW+2 1130 GOSUB 4250 1140 ROW=ROW+1 1150 GOSUB 4250 1160 ROW=ROW+2 1170 GOSUB 4250 1180 ROW=12 1190 GOSUB 4540 1200 U=VAL(S$) 1210 ROW=14 1220 GOSUB 4540 1230 Q=VAL(S$) 1240 REM NEW GAME** 1250 GOSUB 4480 1260 PRINT " FIXED PRODUCTION COST=":" $";STR$(F);"/QUARTER.": : 1270 PRINT " PRODUCTION COST=":" $";STR$(U);"/UNIT.": : 1280 PRINT " WITH NO ADVERTISING AND A":" SELLING PRICE OF $50/UNIT":" A COMPANY WILL SELL" 1290 PRINT " ";STR$(K2/2);" UNITS.": : 1300 PRINT " WAREHOUSE CHARGE FOR":" INVENTORY=";STR$(R*100);"%.": : 1310 PRINT " INTEREST CHARGE ON BORROWED":" MONEY=";STR$(K3*100);"%.": : : : : : 1320 PRINT " PRESS ANY KEY" 1330 CALL KEY(0,KEY,ST) 1340 IF ST<=0 THEN 1330 1350 REM COMPLETE GAME SCREEN*** 1360 GOSUB 4480 1370 CALL HCHAR(1,3,93,28) 1380 CALL HCHAR(24,3,94,28) 1390 CALL VCHAR(2,2,92,22) 1400 CALL VCHAR(2,31,91,22) 1410 CALL HCHAR(19,3,93,28) 1420 CALL HCHAR(11,3,93,28) 1430 CALL HCHAR(1,2,34) 1440 CALL HCHAR(24,2,59) 1450 CALL HCHAR(1,31,35) 1460 CALL HCHAR(24,31,60) 1470 RESTORE 240 1480 COL=2 1490 FOR ROW=20 TO 23 1500 GOSUB 4250 1510 NEXT ROW 1520 CALL VCHAR(20,16,92,4) 1530 READ S$ 1540 FOR ROW=2 TO 7 STEP 5 1550 GOSUB 4200 1560 NEXT ROW 1570 READ S$ 1580 FOR ROW=3 TO 8 STEP 5 1590 GOSUB 4200 1600 NEXT ROW 1610 FOR J=1 TO 5 1620 E(J)=0 1630 NEXT J 1640 P4=0 1650 GOSUB 4980 1660 FOR J=1 TO 2 1670 W(J)=0 1680 D(J)=0 1690 T(J)=0 1700 B(J)=U*I(J)+C(J) 1710 GOSUB 5090 1720 NEXT J 1730 Q=Q+1 1740 GOSUB 3100 1750 GOSUB 2290 1760 GOSUB 4980 1770 REM COMPUTE DEMAND 1780 FOR J=1 TO 2 1790 D(J)=(1-E(5))*.5*(K2+2*V(J)*D1)/(P(J)/50)^N 1800 NEXT J 1810 GOSUB 2980 1820 FOR J=1 TO 2 1830 IF D(J)>I(J)THEN 1860 1840 T(J)=D(J) 1850 GOTO 1870 1860 T(J)=I(J) 1870 T(J)=INT(T(J)) 1880 C(J)=C(J)+T(J)*P(J) 1890 I(J)=I(J)-T(J) 1900 NEXT J 1910 FOR J=1 TO 2 1920 C(J)=C(J)-R*I(J)*U-K3*C(J)*(SGN(C(J))-SGN(C(J))^2)/2 1930 C(J)=INT(C(J)) 1940 IF E(5)=0 THEN 1970 1950 W(J)=0 1960 GOTO 1990 1970 IF T(1)+T(2)=0 THEN 1950 1980 W(J)=INT(10000*T(J)/(T(1)+T(2)))/100 1990 NEXT J 2000 FOR J=1 TO 2 2010 GOSUB 5090 2020 B(J)=C(J)+U*I(J) 2030 IF B(J)>0 THEN 2050 2040 GOSUB 2910 2050 IF B(J)<M1 THEN 2160 2060 IF B(J)<=C(3-J)+U*I(3-J)THEN 2160 2070 P4=17 2080 GOSUB 4930 2090 S$="COMPANY "&STR$(J)&" YOU HAVE REACHED" 2100 ROW=13 2110 COL=3 2120 GOSUB 4200 2130 S$="$"&STR$(.001*M1)&",000 AND WON." 2140 ROW=ROW+1 2150 GOSUB 4200 2160 NEXT J 2170 IF P4<>17 THEN 1730 2180 S$="PLAY AGAIN? (Y/N)_" 2190 ROW=18 2200 COL=3 2210 GOSUB 4200 2220 CALL KEY(0,KEY,ST) 2230 IF ST<=0 THEN 2220 2240 CALL HCHAR(18,21,KEY) 2250 IF KEY<>89 THEN 2280 2260 RESTORE 2270 GOTO 610 2280 STOP 2290 REM INPUT BOTTOM OF SCREEN** 2300 BEG=11 2310 IND=15 2320 FOR J=1 TO 2 2330 ROW=21 2340 COL=BEG-1 2350 S$=STR$(L(J)) 2360 GOSUB 4200 2370 ROW=22 2380 S$=STR$(A(J)) 2390 GOSUB 4200 2400 ROW=23 2410 S$=STR$(P(J)) 2420 GOSUB 4200 2430 IF E(2)<>1 THEN 2510 2440 RESTORE 270 2450 GOSUB 4930 2460 COL=3 2470 FOR ROW=13 TO 14 2480 GOSUB 4250 2490 NEXT ROW 2500 GOTO 2550 2510 ROW=21 2520 GOSUB 4540 2530 L(J)=VAL(S$) 2540 IF L(J)<0 THEN 2510 2550 ROW=22 2560 GOSUB 4540 2570 A(J)=VAL(S$) 2580 IF A(J)<0 THEN 2550 2590 C(J)=C(J)-F-L(J)*U-A(J) 2600 IF E(2)=1 THEN 2620 2610 I(J)=I(J)+L(J) 2620 ROW=23 2630 GOSUB 4540 2640 H=VAL(S$) 2650 IF E(1)<>1 THEN 2730 2660 IF H<=P(J)THEN 2730 2670 RESTORE 280 2680 GOSUB 4930 2690 ROW=13 2700 COL=3 2710 GOSUB 4250 2720 GOTO 2620 2730 P(J)=H 2740 IF H>200 THEN 2620 2750 IF P(J)<=0 THEN 2620 2760 FOR ROW=21 TO 23 2770 CALL HCHAR(ROW,BEG,32,5) 2780 NEXT ROW 2790 BEG=25 2800 IND=29 2810 NEXT J 2820 A2=A(1)+A(2) 2830 IF A2>0 THEN 2870 2840 V(1)=0 2850 V(2)=0 2860 GOTO 2890 2870 V(1)=A(1)/A2 2880 V(2)=A(2)/A2 2890 D1=(K2-K2*EXP(-K*A2))*K4 2900 RETURN 2910 S$="COMPANY "&STR$(J)&" YOU ARE BANKRUPT." 2920 GOSUB 4930 2930 ROW=13 2940 COL=3 2950 GOSUB 4200 2960 P4=17 2970 RETURN 2980 IF P(1)<P(2)THEN 3010 2990 M=2 3000 GOTO 3020 3010 M=1 3020 G4=(P(3-M)-P(M))/P(3-M) 3030 IF G4<=G1 THEN 3090 3040 IF G4<G2 THEN 3060 3050 G4=G2 3060 G5=D(3-M)*((G4-G1)/(G2-G1))*G3 3070 D(3-M)=D(3-M)-G5 3080 D(M)=D(M)+G5 3090 RETURN 3100 IF Q<6 THEN 3440 3110 IF RND<.1 THEN 3160 3120 IF RND<.1 THEN 3210 3130 IF RND<.1 THEN 3310 3140 IF RND<.1 THEN 3380 3150 GOTO 3440 3160 IF E(1)>0 THEN 3120 3170 GOSUB 3610 3180 E(1)=1 3190 Q1=Q 3200 GOTO 3120 3210 I1=INT(RND+1.5) 3220 IF Q-W2<=2 THEN 3130 3230 IF C(I1)<0 THEN 3130 3240 IF C(I1)>200 THEN 3270 3250 C(I1)=.75*C(I1) 3260 GOTO 3280 3270 C(I1)=C(I1)-200 3280 GOSUB 3650 3290 W2=Q 3300 GOTO 3130 3310 J=INT(RND+1.5) 3320 IF Q-W3<=2 THEN 3140 3330 GOSUB 3770 3340 C(J)=C(J)+U*I(J)*.75 3350 I(J)=0 3360 W3=Q 3370 GOTO 3140 3380 IF E(1)=1 THEN 3440 3390 IF Q-W4<=2 THEN 3440 3400 W4=Q 3410 GOSUB 3890 3420 E(5)=1 3430 Q2=Q 3440 IF INT((Q-1)/4)*4<>Q-1 THEN 3970 3450 IF Q=1 THEN 3970 3460 IF E(1)=1 THEN 3970 3470 IF RND>.25 THEN 3540 3480 IF Q<6 THEN 3540 3490 GOSUB 3930 3500 E(2)=1 3510 U=INT(U*(1.1+.1*RND)) 3520 Q3=Q 3530 GOTO 3970 3540 U=INT(U*(1.05+.1*RND)) 3550 RESTORE 290 3560 REND=14 3570 GOSUB 4290 3580 S$="NOW=$"&STR$(U)&"/UNIT." 3590 GOSUB 4200 3600 GOTO 3970 3610 RESTORE 300 3620 REND=18 3630 GOSUB 4290 3640 RETURN 3650 S$="COMPANY "&STR$(I1)&" HAS BEEN THE" 3660 GOSUB 4930 3670 ROW=13 3680 COL=3 3690 GOSUB 4200 3700 RESTORE 320 3710 FOR ROW=14 TO 16 3720 GOSUB 4250 3730 NEXT ROW 3740 S$="HAND IS NOW $"&STR$(C(I1)) 3750 GOSUB 4200 3760 RETURN 3770 S$="COMPANY "&STR$(J)&" HAS SUFFERED FIRE" 3780 GOSUB 4930 3790 ROW=13 3800 COL=3 3810 GOSUB 4200 3820 RESTORE 330 3830 FOR ROW=14 TO 17 3840 GOSUB 4250 3850 NEXT ROW 3860 S$="IN THE AMOUNT OF $"&STR$(INT(U*I(J)*.75))&"." 3870 GOSUB 4200 3880 RETURN 3890 RESTORE 340 3900 REND=18 3910 GOSUB 4290 3920 RETURN 3930 RESTORE 360 3940 REND=17 3950 GOSUB 4290 3960 RETURN 3970 IF E(1)<>1 THEN 4030 3980 IF Q<Q1+2 THEN 4030 3990 E(1)=2 4000 RESTORE 380 4010 REND=14 4020 GOSUB 4290 4030 IF E(5)<>1 THEN 4090 4040 IF Q2=Q THEN 4090 4050 E(5)=0 4060 RESTORE 390 4070 REND=15 4080 GOSUB 4290 4090 IF E(2)<>1 THEN 4190 4100 IF Q3=Q THEN 4190 4110 RESTORE 400 4120 REND=15 4130 GOSUB 4290 4140 S$="$"&STR$(U)&"/UNIT DUE TO" 4150 GOSUB 4200 4160 ROW=17 4170 GOSUB 4250 4180 E(2)=0 4190 RETURN 4200 REM MESSAGE ROUTINE 1** 4210 FOR N=1 TO LEN(S$) 4220 CALL HCHAR(ROW,COL+N,ASC(SEG$(S$,N,28))) 4230 NEXT N 4240 RETURN 4250 REM MESSAGE ROUTINE 2** 4260 READ S$ 4270 GOSUB 4200 4280 RETURN 4290 REM MESSAGE ROUTINE 3** 4300 GOSUB 4930 4310 COL=3 4320 FOR ROW=13 TO REND 4330 GOSUB 4250 4340 NEXT ROW 4350 RETURN 4360 REM INSTRUCTION ROUTINE** 4370 GOSUB 4480 4380 FOR ROW=2 TO 17 4390 READ S$ 4400 PRINT " ";S$ 4410 NEXT ROW 4420 PRINT " REACHES $";STR$(.001*M1);",000 IN":" TOTAL ASSETS.": : : : 4430 PRINT " PRESS ANY KEY" 4440 CALL KEY(0,KEY,ST) 4450 IF ST<=0 THEN 4440 4460 GOSUB 4480 4470 RETURN 4480 REM SCREEN INITIALIZATION*** 4490 CALL CLEAR 4500 CALL SCREEN(5) 4510 CALL VCHAR(1,1,96,48) 4520 CALL VCHAR(1,31,96,48) 4530 RETURN 4540 REM CURSOR CONTROL*** 4550 CUR=BEG 4560 IF CUR>=BEG THEN 4590 4570 CUR=BEG 4580 GOTO 4610 4590 IF CUR<=IND THEN 4610 4600 CUR=IND 4610 CALL GCHAR(ROW,CUR,G) 4620 CALL HCHAR(ROW,CUR,95) 4630 IF CURI<>5 THEN 4660 4640 CURI=0 4650 CALL HCHAR(ROW,CUR,G) 4660 CURI=CURI+1 4670 CALL KEY(0,KEY,ST) 4680 IF ST<=0 THEN 4620 4690 CALL HCHAR(ROW,CUR,G) 4700 IF KEY=32 THEN 4740 4710 IF KEY=45 THEN 4740 4720 IF KEY<48 THEN 4770 4730 IF KEY>57 THEN 4770 4740 CALL HCHAR(ROW,CUR,KEY) 4750 CUR=CUR+1 4760 GOTO 4560 4770 IF KEY=13 THEN 4840 4780 IF KEY<>8 THEN 4810 4790 CUR=CUR-1 4800 GOTO 4560 4810 IF KEY<>9 THEN 4560 4820 CUR=CUR+1 4830 GOTO 4560 4840 REM LOAD INPUT******** 4850 S$="" 4860 FOR N=BEG TO IND 4870 CALL GCHAR(ROW,N,G) 4880 S$=S$&CHR$(G) 4890 NEXT N 4900 IF S$>="0" THEN 4920 4910 S$="0" 4920 RETURN 4930 REM CLEAR MESSAGE BOX** 4940 FOR ROW=13 TO 18 4950 CALL HCHAR(ROW,3,32,28) 4960 NEXT ROW 4970 RETURN 4980 REM DISPLAY QUARTER*** 4990 IF FLAG$="0" THEN 5030 5000 FLAG$="0" 5010 ROW=7 5020 GOTO 5050 5030 FLAG$="1" 5040 ROW=2 5050 S$=STR$(Q) 5060 COL=19 5070 GOSUB 4200 5080 RETURN 5090 REM SUB TO DISPLAY STATS** 5100 IF FLAG$="0" THEN 5130 5110 ROW=3 5120 GOTO 5140 5130 ROW=8 5140 ROW=ROW+J 5150 CALL HCHAR(ROW,3,32,28) 5160 S$=SEG$(STR$(INT(U*I(J)+C(J)-B(J))),1,5) 5170 IF LEN(S$)<5 THEN 5190 5180 S$="****" 5190 COL=2 5200 GOSUB 4200 5210 S$=SEG$(STR$(INT(W(J))),1,3) 5220 IF LEN(S$)<3 THEN 5240 5230 S$="**" 5240 COL=7 5250 GOSUB 4200 5260 S$=SEG$(STR$(INT(C(J))),1,6) 5270 IF LEN(S$)<6 THEN 5290 5280 S$="*****" 5290 COL=10 5300 GOSUB 4200 5310 COL=16 5320 S$=SEG$(STR$(INT(T(J))),1,5) 5330 IF LEN(S$)<5 THEN 5350 5340 S$="****" 5350 GOSUB 4200 5360 COL=21 5370 S$=SEG$(STR$(INT(I(J))),1,4) 5380 IF LEN(S$)<4 THEN 5400 5390 S$="****" 5400 GOSUB 4200 5410 S$=SEG$(STR$(INT(U*I(J)+C(J))),1,5) 5420 COL=25 5430 GOSUB 4200 5440 RETURN 5450 REM SUB YOUR CHOICE**** 5460 S$="YOUR CHOICE ? _" 5470 COL=8 5480 ROW=23 5490 GOSUB 4200 5500 CALL KEY(0,KEY,ST) 5510 IF ST<=0 THEN 5500 5520 CALL HCHAR(23,23,KEY) 5530 RETURN Don't know why the 28... I always use 1... 4220 CALL HCHAR(ROW,COL+N,ASC(SEG$(S$,N,28))) 1 Quote Link to comment Share on other sites More sharing options...
newTIboyRob Posted September 30, 2023 Author Share Posted September 30, 2023 Wow this was a little more involved than I thought! As soon as I get my TI Extended Basic cartridge, I will have to have a play around with all this to see how USING clauses come into the scene for something as simple as: Bananas Grapes Watermelon Handy to know of how the TAB could be used, similar to the PRINT "," in other basics for horizontal output. Thank you. Quote Link to comment Share on other sites More sharing options...
newTIboyRob Posted September 30, 2023 Author Share Posted September 30, 2023 (edited) Wow, @HOME AUTOMATION ... is all that humongous amount of program code what's needed to have a cleared from the top screen or what will that program do exactly? Edited September 30, 2023 by newTIboyRob Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted September 30, 2023 Share Posted September 30, 2023 (edited) This doesn't specifically clear the screen. It does print a string of characters at the line and position you specify... 100 ROW=2 110 COL=4 120 S$="PRINT AT LINE 2 COLUMN 4" 130 GOSUB 1000 ... 1000 REM MESSAGE ROUTINE 1** 1010 FOR N=1 TO LEN(S$) 1020 CALL HCHAR(ROW,COL+N,ASC(SEG$(S$,N,1))) 1030 NEXT N 1040 RETURN 2 hours ago, newTIboyRob said: I will have to have a play around with all this to see how USING clauses come into the scene for something as simple as: Bananas Grapes Watermelon The quotes indicate that the enclosed characters are to be handled as a STRING CONSTANT, as opposed to a NUMERIC VARIABLE. The double colons, in this example, are used initially as a PRINT SEPARATOR, and then as a LINE FEED. Edited September 30, 2023 by HOME AUTOMATION 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted October 1, 2023 Share Posted October 1, 2023 Well if you pick up the FinalGROM you can use other versions of XB. My own is also include with CALL HPUT(row,col,string) or CALL HPUT(row,col,numeric-variable) is written in Assembly so is super fast. Or RXB has CALL HCHAR and CALL VCHAR that are also written in Assembly so is super fast. 2 Quote Link to comment Share on other sites More sharing options...
newTIboyRob Posted October 1, 2023 Author Share Posted October 1, 2023 Thanks, but with this post I don't have FINALGROM, so I was just looking for something in TI Extended Basic that when run does a screen clearing and then makes a list starting at top left of screen at the full left margin and then listing each line down underneath that. Quote Link to comment Share on other sites More sharing options...
Retrospect Posted October 1, 2023 Share Posted October 1, 2023 @RXB ... so in a way, is the GPL Call Clear kind of doing what this is , in Basic ? CALL HCHAR(1,1,32,768) ? 2 Quote Link to comment Share on other sites More sharing options...
RXB Posted October 2, 2023 Share Posted October 2, 2023 On 10/1/2023 at 12:29 AM, Retrospect said: @RXB ... so in a way, is the GPL Call Clear kind of doing what this is , in Basic ? CALL HCHAR(1,1,32,768) ? They are exactly the same in GPL which they are both written in that language. CALL CLEAR is faster than CALL HCHAR(1,1,32,768) you can time this with a really long test. 10 FOR X=1 TO 10000 20 CALL HCHAR(1,1,32,768) or 20 CALL CLEAR 30 NEXT X The CALL CLEAR is a single GPL command ALL >80 while the CALL HCHAR(1,1,32,768) is GPL routine that only puts 1 character on screen each loop. RXB is the only XB version that has most screen routines written in Assembly for fastest performance and can run from only a console. You at least see a comparison of XB and TI Basic CALL HCHAR here. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted November 20, 2023 Share Posted November 20, 2023 Turn on screen saver bit?? Bam, screen cleared 😂 1 1 Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted November 29, 2023 Share Posted November 29, 2023 @newTIboyRob No one mentioned yet this way: 10 PRINT "WANNA":" BUY ":"A GRAPE?" 20 N = 18 30 GOSUB 100 40 INPUT A$ 50 END 100 FOR I=1 TO N 110 PRINT 120 NEXT I 130 RETURN TI BASIC behaves like a calculator with a roll of paper. Oddly, they included such a thing in the 99/4 (original): Equation Calculator. (Menu item 2.) A more limited TI BASIC that used the screen's upper half to show all your variables. (No programs, just single statements) I would construct elaborate PRINT statements in it. 3 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted November 29, 2023 Share Posted November 29, 2023 On 10/1/2023 at 9:13 AM, newTIboyRob said: ...so I was just looking for something in TI Extended Basic that when run does a screen clearing and then makes a list starting at top left of screen at the full left margin and then listing each line down underneath that. Just so we understand - why is this important? If you are just going to display a list, what does it matter if it's at the top or at the bottom? It's the same list. And if you add more lines to it, then soon there will be no difference. The first lines will start scrolling off the screen at the same time. 2 Quote Link to comment Share on other sites More sharing options...
newTIboyRob Posted January 20 Author Share Posted January 20 (edited) Returning here after a bit, I thought of this as just a small thing I was hoping there was a way to do in a TI basic program, that's all, namely looking for a way to see if TI Basic would be able to do what other computers I've used (IBM, Apple) could do: clear the screen, position the cursor directly at the very top of screen at the upper left, and then just start printing the list of items straight down, instead of TI Basic performing its usual way of being like a calculator with a roll of paper which actually just makes the data appear to scroll upwards when multiple items are displayed and the screen isn't cleared. Thus the cursor would not remain at the bottom like when you first start TI Basic. So reiterating, I want to see if it could have it list from cleared screen at top downwards instead of pushing the data upwards in appearance. So we see a cleared screen, then at top left, printing the list downwards: BANANAS APPLES GRAPES instead of down here: BANANAS then pushing that upwards from bottom of screen when next item is listed (Wasn't sure if something like this could be done with DISPLAY or another command or set of commands. It likely will take me some time to get used to TI Basic!) Edited January 20 by newTIboyRob Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted January 20 Share Posted January 20 99 CALL CLEAR 100 ROW=1 110 COL=1 120 S$="BANANAS" 130 GOSUB 4200 140 ROW=2 150 S$="APPLES" 160 GOSUB 4200 170 ROW=3 180 S$="GRAPES" 190 GOSUB 4200 200 GOTO 200 4200 REM MESSAGE ROUTINE 1** 4210 FOR N=1 TO LEN(S$) 4220 CALL HCHAR(ROW,COL+N,ASC(SEG$(S$,N,28))) 4230 NEXT N 4240 RETURN 2 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted January 20 Share Posted January 20 (edited) 1 hour ago, newTIboyRob said: Returning here after a bit, I thought of this as just a small thing I was hoping there was a way to do in a TI basic program, that's all, namely looking for a way to see if TI Basic would be able to do what other computers I've used (IBM, Apple) could do: That I got. What I still don't understand is how it matters? You'll still get your three lines to read, after three PRINT commands, just at the bottom instead of at the top. Why does the difference matter? With the other computers, you don't know where a printed line will end up. It depends on previous screen content. With the TI 99/4A you know that the (usually) most interesting information, the last one printed, is always at the same place. And, as stated above, if you want to display a more complicated form on the display, where you want the same data to be in the same place all the time, then you are problaby advanced enough to benefit from Extended BASIC (or some later variant, but that was what we had in 1982) anyway. Where you have DISPLAY AT. The solution used by other computers will not cater for that either, since their screens will start scrolling too, eventually, if you just keep on printing. If you just use PRINT, then Extended BASIC will behave in the same way as TI BASIC. Edited January 20 by apersson850 2 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted January 20 Share Posted January 20 The closest thing I can think of for you would be this ... and it's still not exactly what you want ...... It's blanking the screen until the "data" scrolls to the desired position and then CALL SCREEN(4) lights the screen up. The TI naturally prints from bottom to top. This program is literally the same as closing your eyes until it suits and open them again. Home Automation provided the only other way TI Basic can do what you want it to do , but by the time you have your screen of data you'll be getting your pension. js99er-20240120142633.webm 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 20 Share Posted January 20 1 hour ago, Retrospect said: Home Automation provided the only other way TI Basic can do what you want it to do , but by the time you have your screen of data you'll be getting your pension. This was the reason that I learned Assembler. I had made a database with a formatted screen for all the fields. Even in XB formatting the screen was painful. (and wasn't old enough to collect pension) My mind was blown when I got it working in Assembler and it flashed on the screen "instantly". 2 Quote Link to comment Share on other sites More sharing options...
newTIboyRob Posted January 20 Author Share Posted January 20 (edited) Thank yous at @HOME AUTOMATION , @Retrospect and @TheBF ... all nice contributions here and I will try these out. I can see that TheBF shared a common desire with me at some point, in making a database with a formatted screen for all the fields. To pinpoint exact screen locations in either BASIC is similar to what I was trying to do here, so I'm glad to see that I'm not alone. In other basics: with the IBM, it's the LOCATE command, with Apple it's VTAB HTAB, etc. I now do have both the TI Extended Basic and Editor Assember (E/A) carts, but I won't be able to use my 4a again until midweek. But by Assembler, you are referring to this same cart I have, yes? If it's not too complicated to explain, can you please mention the steps and/or show a screen of how you accomplished this with Assembler? Edited January 20 by newTIboyRob 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 20 Share Posted January 20 2 hours ago, newTIboyRob said: Thank yous at @HOME AUTOMATION , @Retrospect and @TheBF ... all nice contributions here and I will try these out. I can see that TheBF shared a common desire with me at some point, in making a database with a formatted screen for all the fields. To pinpoint exact screen locations in either BASIC is similar to what I was trying to do here, so I'm glad to see that I'm not alone. In other basics: with the IBM, it's the LOCATE command, with Apple it's VTAB HTAB, etc. I now do have both the TI Extended Basic and Editor Assember (E/A) carts, but I won't be able to use my 4a again until midweek. But by Assembler, you are referring to this same cart I have, yes? If it's not too complicated to explain, can you please mention the steps and/or show a screen of how you accomplished this with Assembler? Yes it is that E/A cartridge and disks that I used. Now moving from BASIC to 9900 Assembler, interacting politely with the BASIC "internals" is not trivial. I had some hardware background in me so it was not totally magic. But the group here is the best of the best for TI-99 coding so that can no doubt provide some training wheels. I might...(maybe) still the have code I wrote on a 35 year our floppy disk. I will see what I can find. To give you some high-level background you are going make some specific sub-routines in Assembler like: position the cursor at (x,y) maybe print text at (x,y) coordinates on the screen write a bunch of text to the screen in multiple places (which will could use the cursor sub-routine and print sub-routine) The you will call them by the name you give them from BASIC. Pretty cool. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.