Marius Posted March 9, 2012 Share Posted March 9, 2012 In several BASIC manuals I read that the format of the POINT instruction is this: POINT #n,x,y where n = iocb channel x = bytes y = sector whatever I try I always get an ERROR already when I type this instruction on a line, no matter what value n, x or y are. Ofcourse the #n is already open in my example. Checked on rev. B and rev. C basic. Is my documentation wrong? The NOTE instruction (same format!) works great! I hope someone can explain it to me. Thanks Marius Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted March 10, 2012 Share Posted March 10, 2012 From http://www.atariarchives.org/creativeatari/Using_Disks_With_Atari_Basic.php: POINT #reference number, sector variable, byte variable: This physically POINTs the disk head to the sector and byte. If that sector and byte are not located within the file opened with that reference number, you get an error message. So if you're getting an error, the sector and byte you're referencing must not be found within the file. Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 10, 2012 Share Posted March 10, 2012 X / Y have to be variables, e.g. you can't have POINT #1,0,0 Quote Link to comment Share on other sites More sharing options...
kenjennings Posted March 10, 2012 Share Posted March 10, 2012 From http://www.atariarch...Atari_Basic.php: POINT #reference number, sector variable, byte variable: This physically POINTs the disk head to the sector and byte. If that sector and byte are not located within the file opened with that reference number, you get an error message. So if you're getting an error, the sector and byte you're referencing must not be found within the file. ...which means a program uses NOTE to remember where it is in the file, and then later it uses POINT to go directly there again. Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 10, 2012 Share Posted March 10, 2012 Some Doses use sector number, others provide a more useful sector offset which allows true random access. With sector # only you need to read the whole file then build your own index. Quote Link to comment Share on other sites More sharing options...
Marius Posted March 10, 2012 Author Share Posted March 10, 2012 Some Doses use sector number, others provide a more useful sector offset which allows true random access. With sector # only you need to read the whole file then build your own index. Thanks for all replies guys. The problem is: I knew this already, and I obviously did not express myself right. The problem is the basic interpreter simply does NOT understand the POINT instruction. It results in an error already as soon as you press RETURN. try this: 10 POINT #1,327,29 (or whatever values) It results in: ERROR - 10 POINT #1,327,29 If my values would be wrong, it would be result in an error during the RUN of the program. The values are RIGHT. I found these values using NOTE #1,x,y (which works). The line above results (ofcourse) in an ERROR 17. In turbobasic it works. So my question again: why is the POINT instruction not accepted by the BASIC interpreter? Quote Link to comment Share on other sites More sharing options...
Marius Posted March 10, 2012 Author Share Posted March 10, 2012 Ah now I see. I should type litteraly point #1,x,y not numbers! odd: turbobasic does accept values like point #1,327,23 Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 10, 2012 Share Posted March 10, 2012 The last 2 paramaters have to be variable names. e.g. so if you were using a Dos with "relative" point ability and wanted to skip 50 bytes: S=0 : B=50 : POINT #1,S,B Quote Link to comment Share on other sites More sharing options...
kenfused Posted March 10, 2012 Share Posted March 10, 2012 (edited) Are you sure they have to be variables with POINT (syntax wise)? I know they have to be with NOTE since you are gettnig the position. With most DOS's you are only going to be giving POINT values you received from doing NOTE so normally you would be using variables though. It does look like you are not getting a syntax error but an error in execution of the line. I believe with SpartaDos the values used are more of a file position vs a sector/offset so you might be able to use values not necessarily received from a NOTE command. NOTE and POINT are useful for... (1) Saving a position in a file and returning to it while a program is running. (2) Use Note to build an index file with some utility program once. Anytime the file you indexed is copied or moved you would have to rebuild the index (except maybe not with SpartaDos) (3) Read through the file and build an index on disk or in an array at program startup with NOTE, and then you can use POINT to randomly access the data. try something like POINT #1, 255, 29 and see if you get a different error. If the first parameter is sector offset it probably has to be 0 to 255. Edited March 10, 2012 by kenfused Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 11, 2012 Share Posted March 11, 2012 Atari Basic, has to be variables. Turbo Basic, can be numeric or an expression. Quote Link to comment Share on other sites More sharing options...
+Larry Posted March 11, 2012 Share Posted March 11, 2012 Isn't there another I/O command that also must be a variable? It strikes me that there is one where in Microsoft Basic, it will accept a numeric value, but in regular Atari Basic, it must be a variable? Can't remember what it is, and may be related to the same code sequence used for both in A8 Basic. (?) -Larry Atari Basic, has to be variables. Turbo Basic, can be numeric or an expression. Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 11, 2012 Share Posted March 11, 2012 GET and INPUT - variables only as parms aside from IOCB#, although that's natural and obvious. XIO - any parm can be a variable or expected type of expression. OPEN/CLOSE - num expression or variable. NOTE - num variables only aside from IOCB#, but again "natural and obvious" It might well be that they mistakenly defined the last 2 parameters for POINT as having to be variables. Although at the time of Basic being written, Dos 1 was probably the only one in existence and relative indexing wasn't available, so it probably didn't make sense to allow constants at that time. Quote Link to comment Share on other sites More sharing options...
kenfused Posted March 11, 2012 Share Posted March 11, 2012 I just tried it out and find it weird they made it work that way. Time to break out the Atari Basic sourcebook and see if he gives a reason. There is little reason to use constants with most DOS's but the fact they did it that way means you can't use an array entry either. Quote Link to comment Share on other sites More sharing options...
atari8warez Posted April 14, 2012 Share Posted April 14, 2012 Some Doses use sector number, others provide a more useful sector offset which allows true random access. With sector # only you need to read the whole file then build your own index. Thanks for all replies guys. The problem is: I knew this already, and I obviously did not express myself right. The problem is the basic interpreter simply does NOT understand the POINT instruction. It results in an error already as soon as you press RETURN. try this: 10 POINT #1,327,29 (or whatever values) It results in: ERROR - 10 POINT #1,327,29 If my values would be wrong, it would be result in an error during the RUN of the program. The values are RIGHT. I found these values using NOTE #1,x,y (which works). The line above results (ofcourse) in an ERROR 17. In turbobasic it works. So my question again: why is the POINT instruction not accepted by the BASIC interpreter? Here's an example of NOTE, POINT usage in Atari Basic (from my decades old Phonebook program): ....... 870 ? " Searching "; 875 NOTE #1,SECTOR,BYTE:INPUT #1;RECORD$ 880 IF RECORD$(1,15)<>LASTNAME$ THEN 875 885 IF RECORD$(16,30)<>FIRSTNAME$ THEN 875 886 IF RECORD$(125,125)=" " THEN 893 887 POSITION 2,8:ATTR$="ANUNSYNI" 888 ? " Record is already deleted. No " " action will be taken. "; 889 ? "}";:FOR WAIT=1 TO 500:NEXT WAIT 890 CLOSE #1:GOTO 45 893 RECORD$(125,125)="D" 895 ? :? " DELETING..."; 900 POINT #1,SECTOR,BYTE:PRINT #1;RECORD$ 905 GOTO 830 ....... Quote Link to comment Share on other sites More sharing options...
Eric Rousseau Posted July 12, 2020 Share Posted July 12, 2020 Hi there.... I'm in the same kind of trouble too.... I have a binary file than contains 10 bytes from 1 to 10 i want to open the file, point to the 5th byte, and read it and every next bytes... Like this OPEN #1,4,0,"D:NUMBERS.BIN" POINT #1,5 FOR F=1 TO 3 GET #1,A ?A NEXT F CLOSE #1 result: 5,6,7 I'm almost certain I did this in Atari basic in the 80's... I used the POINT command to SEEK to a position in a file before reading. Or was this in Quick Basic ? The Note and Point are used for sector/bytes access. I remember using such command to acces random data in a file, like a database file... Was in on Atari ? I need to do so in TurboBasic XL 1.5 Am I missing the "point" ???? Quote Link to comment Share on other sites More sharing options...
Rybags Posted July 12, 2020 Share Posted July 12, 2020 (edited) There's 3 parameters, not 2. The second/third have to be numeric variables. Depending on the Dos in use, the second might be absolute sector or just offset from start of the file. Edited July 12, 2020 by Rybags Quote Link to comment Share on other sites More sharing options...
Graham Dearsley Posted July 13, 2020 Share Posted July 13, 2020 And just for anyone who is still in any doubt. With the POINT command in Atari BASIC, the X and Y variables MUST BE VARIABLES, a number will not do ??? 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.