If the number of scripts for your cockpit grows it becomes more difficult to put them into one file without variable number clashes. You also have to manually group your Var 0 statements and getting the overall view over your program becomes difficult.
In those situations it is good software engineering practice to split up your application into several self-contained logical units. Config_sioc supports this practice.
I will show the necessary steps based on the same example as above in the single file approach. Of course one would not split up such a small file, but it is just the mechanism I'd like to show you.
We start with the Notepad editor and create first a file that handles the state of the parking brake
and then a text file that handles the led of the parking brake (note that both files have a variable numbered 10).
Both files are saved
In order to be able work with multiple files and config-sioc.exe we create a config-sioc.ini file that defines the text files that make up our application. We do that by writing such a file with the Notepad editor. The first line is fixed and defines the languages setting of config-sioc.exe (1 = Spanish, 2 = English), but the second and third line specify where config-sioc.exe should look for our script files. This file has to be put in the same folder as config-sioc.exe (normally the SIOC folder).
Instead of Files, Import TXT, like we do in the single file approach, we now select 'Group, Run', and compilation will start immediately
There are no errors. Note that config-sioc compiles in three phases, which is very convenient for us programmers, because we do not have to import missing variable names or -numbers into our file, we can just make use of a variable that is defined in another file.
We now click at the gray OK button, bottom right, to close the log window, and inspect the config-sioc.exe main window showing the compiled code.
There is one big difference with the single file approach: config-sioc has automatically renumbered the variable numbers in our files, instead of twice var number 10, we now see vars 1 and 2. It has resolved the number clash, something we as programmers no longer have to worry about.
Just like in the single file approach we select 'Files, Save as' and save the compiled code as parkbrake_light.ssi
We are ready, the folder shows the compiled file (type SIOC compiled script), next to the two text files
Note: the end result, the file parkbrake_light.ssi, is semantically the same as in the single file approach, only the way to get there is different. Sioc.exe will not see any difference at all.