BBC BASIC
« Filing with SLIDE on a Mac with Sierra OS »

Welcome Guest. Please Login or Register.
Oct 24th, 2017, 11:11am


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Filing with SLIDE on a Mac with Sierra OS  (Read 122 times)
dje4816
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 6
xx Filing with SLIDE on a Mac with Sierra OS
« Thread started on: Feb 8th, 2017, 3:42pm »

I'm using BBC Basic SDLIDE on my Mac (Sierra OS). I'm not having much success with filing. I would be grateful if you could give me a short example program to save a file containing mixed data to a specified directory. I have not been able to find the "saved" file anywhere on this Mac. Thanks for you help. Dave.
User IP Logged

Dave
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 605
xx Re: Filing with SLIDE on a Mac with Sierra OS
« Reply #1 on: Feb 8th, 2017, 11:05pm »

on Feb 8th, 2017, 3:42pm, dje4816 wrote:
I would be grateful if you could give me a short example program to save a file containing mixed data to a specified directory. I have not been able to find the "saved" file anywhere on this Mac.

There seem to be two quite separate questions here: how to save mixed data and how to find files.

On the second point, my recommendation would be always to save files at a location relative to one of the predefined paths: @dir$, @lib$, @tmp$ or @usr$. That way the program should run equally well whatever the platform (Windows, Linux, Mac OS, Android). If you need to know the 'true' (absolute) path, for example to access the file from outside BBC BASIC, just print it. For example:

Code:
      PRINT @usr$ 

The first question is more difficult to answer, since there are so many factors at play. In general it will depend on whether or not you need to access the contents of the files outside BBC BASIC. If you don't, in other words the file will be written by a BASIC program and read by a BASIC program, it will probably be easier to use the original PRINT# and INPUT# statements.

If, on the other hand, you need the file to be 'compatible' - so that it may be read or written by programs other than BBC BASIC - it is probably better to use BPUT# and GET$# (and of course store numeric values as text rather than binary). But there are many more factors to consider, including issues such as whether you want to use a Linux-style line termination (LF) or a Windows-style line termination (CRLF). I could write an essay on this stuff!

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls