Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:31 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 - shortcut for starting apps/games/demos...

Author Message
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 09:32pm 15 Dec 2020
Copy link to clipboard 
Print this post

Hi,
maybe you have found this or you have another method, but maybe this can help somebody.

My method for creating shortcuts for starting different applications.

1. Create somewhere directory (my is LINKs)
2. Into this directory put for every app needed short BASIC program, I have here:
SE.BAS for SimplEd, NC.BAS for Napoleon Commander, LIB.BAS for library testing etc.
3. in every BASIC program write just command RUN with full path to application. So my SE.BAS looks so:
RUN "/JirSoft/SimplEd/SimplEd.BAS"

4. OPTION SEARCH PATH "/LINKs" (path to your link directory

Now I can just write *se to start SimplEd... If your apps are using INCLUDE files, maybe you need to put to the begin of BASIC program line:

CHDIR MM.INFO$(PATH)

This will after start of the program switch current directory to path where was program startet from.
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:42pm 15 Dec 2020
Copy link to clipboard 
Print this post

Hi Jiri,

See http://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12409

- Use EXECUTE instead of calling RUN directly that way you can pass through any command line arguments.
- Don't worry about #INCLUDE that is always resolved relative to the location of the file doing the including.
- Avoid calling CHDIR or at least always make sure you CHDIR back as soon as you can as it is really annoying if when a program exils it leaves you in a different directory from where you started.
- Don't forget to refer to any assets/file resources that a program needs by their absolute path, MM.INFO$(PATH) is your friend.

YMMV,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 12:50am 16 Dec 2020
Copy link to clipboard 
Print this post

Hi Tom,

  thwill said  Hi Jiri,

See http://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12409

- Use EXECUTE instead of calling RUN directly that way you can pass through any command line arguments.
      you are right with arguments, I use it just for quick start of apps, not tools

- Don't worry about #INCLUDE that is always resolved relative to the location of the file doing the including.
      that's exactly the problem, my method start the program with CWD set as LINKs directory, so it will not find relative includes

- Avoid calling CHDIR or at least always make sure you CHDIR back as soon as you can as it is really annoying if when a program exils it leaves you in a different directory from where you started.
      again, I'm starting the programs in many different directories, so it make no sense to go back (but can be done)

- Don't forget to refer to any assets/file resources that a program needs by their absolute path, MM.INFO$(PATH) is your friend.
      it was in my last point. I'm using absolute paths just on includes from my library, everywhere else it's better use just relative paths because of possibility of moving the app
YMMV,

Tom


But anyway thanks
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025