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 : have we discused relitive file paths befor?
Author | Message | ||||
mclout999 Guru Joined: 05/07/2020 Location: United StatesPosts: 469 |
When I get a program here it will only run if it is in the same location as the programmer had it. I was wondering if there is any way to make a BAS file load files first from its own directory. If the programmer has to hardcode paths it really is tedious to have to save the files on the same drive or edit the file to hardcode the paths. I guess I am just used to dos that would assume the file and sub directories relative to the program starting folder. It tend to make for a mess of the folder structures or forces me to put programs on a limited Flash drive a: Maybe this was covered before I can't remember or find it here in search. Sorry if this is all well-known. |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2135 |
What platform? For the Pico:- Then you could try ./file for the current directory and ../file for the one above as they are relative to that. eg LIST "./file.txt" |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6098 |
I am having the most success by recording the path to the program on startup with dim progFolder$ = mm.info$(path) I then use that to convert relative paths to full paths as required. Jim VK7JH MMedit MMBasic Help |
||||
mclout999 Guru Joined: 05/07/2020 Location: United StatesPosts: 469 |
Thank you both for the info and I will try to figure it out but where can I get the manual that covers all the stuff I have been seeing on the forum for the PICO HDMIUSB I am using? Is there a mostly complete Manual besides the one on geoffg.net? That one is about the VGA variant. |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6783 |
There hasn't been a manual for a while. :) The HDMI and USB stuff wasn't available at that time. I did this not long ago and I've just added a bit that I missed (HDMI pins) and brought it up to date, I think. MMBasic catchup - 22-10-24.pdf Edited 2024-10-23 00:40 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
mclout999 Guru Joined: 05/07/2020 Location: United StatesPosts: 469 |
I found an older version of this one so this is nice to see. It goes up to B4 and we are now on RC9 I hope not much has changed from your document. Thanks. |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6783 |
This one goes up to RC8. RC9 is bug fixes. Nothing to add, really. Obviously, it starts more or less where the current manual(s) end so you need at least one of those as well. There isn't one manual that covers all versions now, it was getting too big to manage. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Print this page |