While using my ToolBoxFile manager I have discovered that loading source code to the IDE using RunProgram() don't work anymore. I have used this technique for years without issues and I don't know when it became broken.
Do I need to do something differently ? Something broken in the IDE ? (If so this topic should be moved to Bug - IDE section)
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Project name : Loading source code to IDE
; File Name : Loading Source IDE.pb
; File version: 1.0.0
; Programming : Seems to be OK from this side
; Programmed by : StarBootics
; Date : October 12th, 2023
; Last Update : October 12th, 2023
; PureBasic code : V6.03 LTS
; Platform : Windows, Linux, MacOS X
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Notes
;
; You need to compile this tiny program and set it
; as a custom tool in order to see the problem.
;
; I have used this technique for years without any
; issues, but since recently it no longer work.
; When launched from the Tools menu, I see the
; correct path to the IDE and RunProgram() return
; 1.
;
; What I would like to do is to tell the IDE to
; load a specific source code from another
; program.
;
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
SourceFile.s = GetHomeDirectory() + "MySourceCode.pb"
If CreateFile(0, SourceFile)
WriteString(0, "; Something to see")
CloseFile(0)
EndIf
IDE.s = GetEnvironmentVariable("PB_TOOL_IDE")
MessageRequester("PB_TOOL_IDE", IDE)
If IDE <> ""
Result.i = RunProgram(IDE, SourceFile, GetPathPart(IDE))
MessageRequester("RunProgram", Str(Result))
EndIf
; <<<<<<<<<<<<<<<<<<<<<<<
; <<<<< END OF FILE <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
If you run the program just by launching it directly it will show nothing. You really need to launch it form the Tool menu. So you need to add an entry for it in the Configure Tools.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
I see. So I just tried it as a tool and it works as expected: a new PureBasic instance was run with "MySourceCode.pb" as a blank source. You don't have "only one instance" enabled in PureBasic's prefs by mistake?
Also, is the new source meant to blank? Or is it meant to load an existing source? It doesn't load existing sources for me if I do this:
BarryG wrote: Fri Oct 13, 2023 3:37 am
I see. So I just tried it as a tool and it works as expected: a new PureBasic instance was run with "MySourceCode.pb" as a blank source. You don't have "only one instance" enabled in PureBasic's prefs by mistake?
I was meant to load the source code in the running IDE instance. As I have said it used to work until recently. If I disable "Run only one instance" it work as expected, but it's completely useless. I don't want to have multiple instances of the IDE running.
BarryG wrote: Fri Oct 13, 2023 3:37 am
Also, is the new source meant to blank? Or is it meant to load an existing source? It doesn't load existing sources for me if I do this:
The loaded source was not meant to be blank. It's supposed to load the source code from a directory full of non compiled libraries. With the given example, you should have the comment inside the source.