|
Post by metro on Dec 29, 2020 20:28:24 GMT -5
Kick starting an external (editor) program works for me but if I want that program to open a specific file I do not get the desired result.
With a Bash script the editor will start and load the required file but from LB5 I get a new blank file.
'print DefaultDir$ 'Windows specific example, but RUN is also supported on 'MacOS and Linux. open "example.txt" for output as #runx print #runx, "This is a test." print #runx, "The quick brown fox jumped over the lazy dog." print #runx, "Now is the time for all good men to come to the aid of their country." print #runx, "We will go to the moon and do the other things, not because they are easy but because they are hard." close #runx prog2run$= DefaultDir$;"example.txt" print prog2run$ RUN "xed prog2run$" 'RUN "DefaultDir$;example.txt"
EDIT: Hardcoded path works
RUN "xed /home/laurie/lb5x32-351/lb5alpha-351/bas_files/example.txt"
|
|
|
Post by Brandon Parker on Jan 1, 2021 22:28:56 GMT -5
I think you are using the "Run" statement incorrectly. You need to concatenate the prog2run$ variable with the "xed " string. I used Notepad.exe, but the premise is still the same. Here is how it should be set up. RUN "notepad.exe ";prog2run$ Note that the variable is outside of the quotes and concatenated ... With the way you have it, you are literally trying to open a file with a filepath and name as "prog2run$" ... {:0) Brandon Parker
|
|
|
Post by metro on Jan 2, 2021 0:17:01 GMT -5
I think you are using the "Run" statement incorrectly. You need to concatenate the prog2run$ variable with the "xed " string. I used Notepad.exe, but the premise is still the same. Here is how it should be set up. RUN "notepad.exe ";prog2run$ Note that the variable is outside of the quotes and concatenated ... With the way you have it, you are literally trying to open a file with a filepath and name as "prog2run$" ... {:0) Brandon Parker Thanks Brandon, 🤦
|
|