XPost: alt.lang.basic   
   From: kr-lund@nogarbage.online.no   
      
   Mark Whitlock wrote:   
   > Knut Roll-Lund wrote:   
   > [Lots deleted for brevity]   
   >   
   >> I think one of the bigger problems with porting basic programs would   
   >> be access to files, AFAIK this is completely different from machine to   
   >> machine, and because the available functions behave differently you   
   >> must also rewrite the code around the actual disk functions. I would   
   >> guess that most programs that would do something useful would have   
   >> disk access in them.   
   >>    
   >> Knut   
   >   
   > Knut ,   
   > I don't quite follow you about the problems with disk access.   
   > The following excerpt is from "Microcomputer BASIC" by Edward J.   
   > Coburn. Chapt 11-3 2nd.paragraph 'The IBM can use the same OPEN   
   > statement as the Radio Shack, but it can also use a modification   
   > ...' [describes short form].   
   > Even the apple is similar, they all seem to OPEN,CLOSE,GET,   
   > PUT,INPUT,FIELD,?SET and PRINT for file access. After all isn't the   
   > purpose of using a 3GL like Basic ,to abstract the user from the   
   > hardware ?   
   > Maby the key is when you say "behave differently" ,do you mean   
   > things like 'open "R",1,"file_name",128' has to be changed to   
   > 'open "file_name" FOR random ACCESS read write AS #1 LEN=128'   
   > (from GW-BASIC Users Guide and Reference ,Microsoft press).   
      
   You are right. Sorry, I was wrong.   
      
   TRS-80 I/III DISK BASIC vs. GWBASIC has almost identical disk handling.   
   I remembered incorrectly. There is some syntax that makes GWBASIC look   
   different but it is optional.   
      
   I think it is not the problem unless you want to use the datafile from   
   the TRS-80. I think that data files made by the TRS-80 will have CRLF   
   problems at least, maybe also other delimiters, but data made by GWBASIC   
   should read back under GWBASIC just fine with the TRS-80 code. I would   
   recommend to look through the code though. Even string handling seems to   
   be much the same.   
      
   So why is this similar, TRS-80 I/III BASIC is made by Microsoft and so   
   is GWBASIC. I wouldn't know if the DISK BASIC extension on the I/III   
   that came with TRSDOS was made by Microsoft, maybe it was in the   
   original package from Microsoft. Maybe Tandy made the disk extension and   
   Microsoft thought it was neat.   
      
   It is the Apple2 and other machines that are very different in the disk   
   handling. Apple2 has no GET (does something else), PUT, FIELD, LSET or   
   RSET and it will move the focus from the keyboard and takes INPUT   
   directly from the file instead of the keyboard... so one must close the   
   file to do input from the keyboard (behaves differently).   
      
   Commodore C64 is different too.   
      
   3GL... would the original BASIC have any high level disk handling at   
   all? If it had that I would have thought that it would be more the same   
   on different machines. I think BASIC is not a good example of freedom   
   from hardware. Almost any hardware outside the CPU, RAM/ROM, console   
   text i/o would have different BASIC extensions.   
      
   Porting TRS-80 I/III to GWBASIC would probably still give problems and   
   that is because of the display. The graphics are not the same and the   
   control codes are different. First the TRS-80 has 16 lines of 64   
   characters so writing beyond 64 characters would wrap to the line below   
   automatically... often used. CHR$(192+X) would expand to X spaces. There   
   is also the wide 32 char mode. And the graphic characters from CHR$(128)   
   to CHR$(191). The control codes below CHR$(32) are also different.   
      
   And POKEs and PEEKs would not work.   
      
   > This stuff can be done by simple munging if the source is in ascii.   
   > Or am I completely missing the point ?   
      
   My point is that if you use an emulator you don't need to look at the   
   code at all, you just run it as you used to. There are convenient tools   
   for exporting and importing data to the "host".   
      
   Knut   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|