paladina Posted August 15, 2010 Share Posted August 15, 2010 Question about uploading parts in Turbo Basic. Ok If I have body of program File1 10 REM WORLD 20 ?"HELLO WORLD" 30 ENTER"D:File2" 40 GOOTO 20 File2 20 ?"HELLO ATARI" 25 ?"I GOT IT" I need to upload others file, but after command Enter its over my program... how it do to auto continue? thx. Quote Link to comment Share on other sites More sharing options...
pps Posted August 15, 2010 Share Posted August 15, 2010 (edited) Question about uploading parts in Turbo Basic. Ok If I have body of program File1 10 REM WORLD 20 ?"HELLO WORLD" 30 ENTER"D:File2" 40 GOOTO 20 File2 20 ?"HELLO ATARI" 25 ?"I GOT IT" I need to upload others file, but after command Enter its over my program... how it do to auto continue? thx. For File2 use this: SAVE"D:FILE2.TBA" Within File1: 30 RUN "D:FILE2.TBA" You even could load and start COM files with BRUN "D:File.COM" Edited August 15, 2010 by pps Quote Link to comment Share on other sites More sharing options...
pps Posted August 15, 2010 Share Posted August 15, 2010 (edited) Sorry, some mistake makes another post -> Erasing option would be fine Edited August 15, 2010 by pps Quote Link to comment Share on other sites More sharing options...
paladina Posted August 15, 2010 Author Share Posted August 15, 2010 I need this for DISC, "D:xx.xx" ! how is possible to upload parts in body of program? I do a game i 3 language,and need load a parts of others laguage to body of game, then any others parts for subgames... then who can this? Quote Link to comment Share on other sites More sharing options...
+David_P Posted August 16, 2010 Share Posted August 16, 2010 Probably easiest to define some data storage (srings?) and read the data in to the string, with the same language part in the same order in each data set, with some sort of index. So, for example, if there are four lines of text you need to read in: 10 DIM TXT$(160): REM ASSUME FOUR LINES OF 40 CHARS EACH, MAXIMUM 20 DIM LNST(4): REM LINE START OF EACH OF THE FOUR LINES 30 OPEN #1,4,0,"D:TEXTFILE.LNG": REM CHANGE FOR EACH LANGUAGE; TO GET FANCY, USE A STRING AND CHANGE IT DEPENDING ON THE LANGAUGE 40 INPUT #1,TXT$: REM ASSUMES NO CR (ASCII 155) IN THE STRING 50 FOR I=0 TO 4 60 GET #1,OFFSET 70 LNST(I)=OFFSET 80 NEXT I Then, to print each line, assuming the line you want to print is LINENO ? TXT$(LNST(LINENO),LNST(LINENO+1)-1) Quote Link to comment Share on other sites More sharing options...
paladina Posted August 16, 2010 Author Share Posted August 16, 2010 Hm,some mist beacuse its dont work program D.DAT 50 DATA SECOND 54 GOTO 45 save as LIST"D:D.DAT" body program 10 DIM A$(12) 20 RESTORE 50:READ A$ 30 ?"HELLO ";A$ 40 ENTER"D:D.DAT" 45 RESTORE 50:READ A$ 48 ?"THATS ALL" 49 END 50 DATA FIRST 55 GOTO 45 ------------ Ok, I need to upload and change parts of my program during Running it and continuing in running... but after the command ENTER"D:D.DAT" its load my news dat and STOP... only READY... no continue!!!!... and I must so load about 60 new lines... then the solution please thx. Ps.: I have got many and long lines... the easy way ist via command ENTER...but how it do to continue mz running program? Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 16, 2010 Share Posted August 16, 2010 Hmmm... the ENTER command actually returns you to the Ready prompt if you execute it within a program. There's a way around that. You need to put an extra line into your second bit of program. In the case of your last one there, you'd want a "GOTO 45". So, to get what you need, try this - you can just enter it from immediate mode: OPEN #1,9,0,"D:D.DAT" ? #1;"GOTO 45" CLOSE #1 That works in normal Atari Basic, no guarantee it'll work in TB, but worth a try. Quote Link to comment Share on other sites More sharing options...
+Eyvind Bernhardsen Posted August 16, 2010 Share Posted August 16, 2010 The usual trick to get around this problem is to use "forced keyboard" mode. Here's how it works: LIST this short program to disk as "D:FOO": 50 ? "NEW LINE ADDED" Then NEW, type in and run the following code: 10 ? CHR$(125):POSITION 2,2:? "ENTER";CHR$(34);"D:FOO";CHR$(34) 20 POSITION 2,5:? "POKE842,12:CONT" 30 POSITION 0,0 40 POKE 842,13:STOP The code should run, append line 50 from D:FOO to your program, then continue and print the "NEW LINE ADDED" message. Go ahead and delete line 50 and run it again to make sure. POKE 842,13 puts the screen editor in a mode where it behaves as if the RETURN key is continually being pressed, passing all lines it encounters to the BASIC interpreter. POKE 842,12 restores the editor to normal mode, and CONT obviously continues the program. You're not limited to just ENTERing programs this way, of course: I've seen line renumberers that use forced keyboard mode. Just remember to POSITION the statements to be entered to avoid the "STOPPED AT LINE" message and any prompts from BASIC. Press RESET to recover if a prompt makes the editor miss the CONT line. The downside to this technique is that you have to mess up the screen. Changing the text colour to equal the background colour hides the text, but you need to be in gr. 0 for it to work. This is an old Atari BASIC technique, but I tested that it works in Turbo BASIC too. 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.