SRL Archive - Suggestions

CTRL + Click while in include files


TomTuff

2010-09-29 22:20:59

I know that you can CTRL + Left lick while in a script (i. e. something not in an includes folder) to open the include that function/procedure in its own respective include file, however you CANNOT do this while in an include file. e. g., if i'm in an SRL file and i want to know what srl_Warn does, i cannot ctrl + click it to open whichever include file srl_Warn is in. This feature would be a very nice addition to simba.

Coh3n

2010-09-29 22:25:16

Wow I didn't even know you could do that in a script. But yeah, while in an include file, the function/procedure still gets highlighted/underlined when you hold control, but it's file doesn't open.

Dgby714

2010-09-29 22:41:15

This is because Simba doesn't know what file that particular procedure comes from =/

When you include SRL/SRL.scar, it includes the the other files and simba can find it.

But looking at SRL files individually Simba is only using that file.

Bad Boy JH

2010-09-30 08:22:34

I know this may seem stupid, but perhaps a modification to each script like
{ifdef *something*}
{$i Include Srl/Srl.scar}
{endif}

(sorry not really sure how to use the ifdef statements)

That would allow each script to allow navigation between the scripts, but not interfere with the compilation of the script.

nielsie95

2010-09-30 08:23:42

Or include all the files in each file using include_once.

Wizzup?

2010-09-30 08:32:33

include_once would indeed take care of this. Perhaps a good idea to implement.

TomTuff

2010-10-02 15:12:55

From: Wizzup?
include_once would indeed take care of this. Perhaps a good idea to implement.


how does include_once work, and can you confirm whether or not it will be implimented into SRL

Bad Boy JH

2010-10-06 07:37:20

include once, is how it sounds, it will include a file only if it has not already been included, by adding this to all scripts, it allows the Ctrl + Click navigation through all includes

basically the SRL.scar include needs all to be changed to Include once, and then all scripts need to "include once " SRL.scar

Wizzup?

2010-10-06 09:59:01

From: TomTuff
how does include_once work, and can you confirm whether or not it will be implimented into SRL


It'll probably be implemented within a few weeks, I suppose.

nielsie95

2010-10-06 10:08:35

From: Bad Boy JH
include once, is how it sounds, it will include a file only if it has not already been included, by adding this to all scripts, it allows the Ctrl + Click navigation through all includes

basically the SRL.scar include needs all to be changed to Include once, and then all scripts need to "include once " SRL.scar


Nothing will have to be changed inside scripts ;)

Gu3st...

2010-10-06 12:38:27

From: nielsie95
Nothing will have to be changed inside scripts ;)
This is true, I made MSI use include_once, and MSI still worked fine after that :) (check Setup.simba)

Why not implement this to SRL right away? I see no point in waiting…

nielsie95

2010-10-06 12:51:15

But you only include them in setup.simba, from what I can see?
To make this work, you'll need to include all the everything that the files depends on. This way, every file is able to compile (you'll get an error that it can't find the mainloop, though). I had this idea in mind for SRL 5, because it's easier to check if SRL still compiles and you can add tests for functions in the file.

Bad Boy JH

2010-10-07 07:59:40

no you see all the files include (include once) the main file (SRL.scar) and the main file then uses include once so they all dont get included more than once…i think it should work ok…

nielsie95

2010-10-07 08:11:49

I'm afraid it wouldn't. If you run a file from SRL, the file itself will be included. Also, that would include a lot of files that aren't needed by that specific file.

Gu3st...

2010-10-07 10:48:57

From: nielsie95
But you only include them in setup.simba, from what I can see?
To make this work, you'll need to include all the everything that the files depends on. This way, every file is able to compile (you'll get an error that it can't find the mainloop, though). I had this idea in mind for SRL 5, because it's easier to check if SRL still compiles and you can add tests for functions in the file.
I don't get any errors at all

nielsie95

2010-10-07 11:09:17

But you can't control+click inside the include files either, right?

Gu3st...

2010-10-07 13:40:35

Oh! Now I get it lol
No I'm pretty sure I can't do that.. :P
Shouldn't be able to at least