BBC BASIC
« Running program on MacOS »

Welcome Guest. Please Login or Register.
Sep 24th, 2017, 01:28am


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: Running program on MacOS  (Read 164 times)
mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Running program on MacOS
« Thread started on: Feb 21st, 2017, 11:59am »

In the Announements thread on Feb 6th, 2017, 1:53pm, Richard Russell wrote:
On most platforms you can simply specify the name of a BASIC program (as a tokenized .bbc file) on the command line. For example on both Windows and Linux you can do:
Code:
bbcsdl path/to/program.bbc 
and it will run that program. Indeed if you omit the command-line argument BBCSDL will search for the file bbcsdl.bbc in the current directory and run it if found. That's the mechanism by which the 'choose IDE' launcher is executed.


I found, after lots of trials and searching, that the following code in a MacOS command file will start a BBC program...

Code:
PARENT_DIR=$(dirname "$0")
open -a /Applications/BBCBasic.app --args "$PARENT_DIR/CVSapp/CVS.bbc" 

... which is called CVS.bbc in the directory CVSapp which is in the same directory as the command file. The command file must have a suffixed filetype of .command and must have had a 'chmod u+x <file>.command' done to it so it has execute authority.

Note this is not necessarily the best way - can anyone improve on it ?

One disadvantage is that it also opens a 'command window' using Terminal, but this can be closed when the program starts. I have not found a way of avoiding this, either in MacOS or using a .cmd file in Windows to achieve the same.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 587
xx Re: Running program on MacOS
« Reply #1 on: Feb 21st, 2017, 2:13pm »

on Feb 21st, 2017, 11:59am, mavison wrote:
I found, after lots of trials and searching, that the following code in a MacOS command file will start a BBC program...

That's useful to know, well discovered! I wonder what the usage scenario is however, and how it compares with the alternative of creating a new self-contained application that runs your own program rather than the 'Choose IDE' tool.

Conceptually the latter is easy to achieve (in the simplest case replacing 'bbcsdl.bbc' with your program) although it will result in an app that doesn't have a valid Digital Signature, which could well cause issues with deployment.

Richard.
« Last Edit: Feb 21st, 2017, 2:14pm by Richard Russell » User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: Running program on MacOS
« Reply #2 on: Feb 21st, 2017, 2:32pm »

I wanted to avoid any signature issues.
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