Board Logo
« Running external editor WITH current file from JB »

Welcome Guest. Please Login or Register.
Jan 18th, 2018, 3:41pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Problems installing JB? Read the Vista/Win7 Installation FAQ

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Running external editor WITH current file from JB  (Read 167 times)
tsh73
JB-Supporter


member is offline

Avatar




PM

Gender: Male
Posts: 3636
xx Running external editor WITH current file from JB
« Thread started on: Jun 23rd, 2017, 5:13pm »

Ok, here's JB program that allow to run external editor with current program loaded.

Name it RunLastFileWith.BAS
save it in your JB folder
compile it to your JB folder as RunLastFileWith.tkn

Now set up external programs to
Code:
"path_to_\jbrun101.exe" "path_to_\RunLastFileWith.tkn" "path_to_\yourExternalEditor.exe" 

(examples are in code).

That's all (well, it works for me).

Code:
'compile to TKN
'run from RUN menu with path-to-exe
'runLast
'"C:\progs\Just BASIC v1.01\jbrun101.exe" "C:\progs\Just BASIC v1.01\RunLastFileWith.tkn"
'runLast Context
'"C:\progs\Just BASIC v1.01\jbrun101.exe" "C:\progs\Just BASIC v1.01\RunLastFileWith.tkn" "C:\Program Files\ConTEXT\ConTEXT.exe"
'runLast Notepad++
'"C:\progs\Just BASIC v1.01\jbrun101.exe" "C:\progs\Just BASIC v1.01\RunLastFileWith.tkn" "C:\progs\Notepad++Portable\Notepad++Portable.exe"
'
'1) get LastFileName$ 
nomainwin
open "justbasic1.ini" for input as #1
while not(eof(#1))
    line input #1, aLine$
    if word$(aLine$, 2) = "recent" and word$(aLine$, 3) = "files" then
        nFiles = val(word$(aLine$, 1) )
        exit while
    end if
wend
if not(nFiles) then
    close #1
    notice "ERROR: (Recent files) block Not found"
    end
end if
for i = 1 to nFiles
    line input #1, aLine$
next
print "Last file is"
print     aLine$
LastFileName$=aLine$
close #1
'2) get command line
qq$=chr$(34)
if CommandLine$<>"" then
    'notice "cmd line"+chr$(13)+CommandLine$
    run CommandLine$+" "+qq$+LastFileName$+qq$
else
    prompt "Last file name is ";LastFileName$
end if


end
 
User IP Logged

Q: "And if I took your codes and compile them, and sell them for a profit"?
A: Go ahead. I had my share of good then I coded it for fun, if you can make better use of it - please do.
(enjoying JB 1.01 on WinXP, netbook and desktop)
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

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