The solution. This:
Code: Select all
Run>%COMMAND_LINE% "%v_scp_next_3%"
Code: Select all
ExecuteFile>%v_scp_next_3%
Having solved that, I decided to get fancy. As a developer or tester, depending on the situation, I might want to
- quit the script
- work on the script or test it, by running the same script over and over, again and again
- traverse once through all the scripts, in order
- loop through all the scripts in order, over and over
Code: Select all
Label>MyExit
Include>%SCRIPT_DIR%\load_prog_ini.scp
GoSub>NEXT_ONE
Let>RP_WAIT=0
If>%v_debug%=Y
Ask>%SCRIPT_NAME% IS DONE. Do you want to run the next one?,v_continue
If>%v_continue%=YES
Ask>Examine variables?,v_examine
If>v_examine=YES
//this is here on purpose, in case you want to look at variable values
**BREAKPOINT**
Endif // v_examine
//Dev and Test
MessageModal>%SCRIPT_DIR%\%SCRIPT_NAME% will run %v_next_scp%
ExecuteFile>%v_next_scp%
Wait>2
Exit>
Else
MessageModal>%SCRIPT_DIR%\%SCRIPT_NAME% will now end
Exit>
Endif // v_continue
Else
//Production
Run>%SCRIPT_DIR%\%v_next_prog%
Exit>
Endif
Exit>
Code: Select all
//scripts
//SCRIPTS LOOP, TRAVERSE, REPEAT OR END
//LOOP RUNS EACH SCRIPT IN ORDER, AND LOOPS FOREVER
//TRAVERSE RUNS EACH SCRIPT ONCE IN ORDER
//REPEAT RUNS EXECUTING SCRIPT AGAIN
//END STOPS THE EXECUTING SCRIPT
// one for scripts, one for compiled
Let>v_scp_repeat=TRAVERSE
Let>v_exe_repeat=TRAVERSE
ArrayDim>v_script,3
Let>v_script_1=%SCRIPT_DIR%\start.scp
Let>v_script_2=%SCRIPT_DIR%\middle.scp
Let>v_script_3=%SCRIPT_DIR%\end.scp
Let>v_scp_first=%v_s%
//compiled script names
ArrayCount>v_script,v_ra_cnt
ArrayDim>v_prog,%v_ra_cnt%
Let>v_kay=0
Repeat>v_kay
Let>v_kay=v_kay+1
StringReplace>v_script_%v_kay%,scp,exe,v_prog_name
Let>v_prog_%v_kay%=v_prog_name
Endif
Until>v_kay=%v_ra_cnt%
//Calculates the next script possible
SRT>NEXT_ONE
ArrayCount>v_script,v_ra_cnt
Let>v_this_script=%SCRIPT_DIR%\%SCRIPT_NAME%.scp
Let>v_kay=0
Repeat>v_kay
Let>v_kay=v_kay+1
Let>v_compare=v_script_%v_kay%
If>%v_compare%=%v_this_script%
Let>v_jay=v_kay+1
Let>v_kay=%v_ra_cnt%
Let>v_next_scp=v_script_%v_jay%
StringReplace>v_next_scp,scp,exe,v_next_exe
Endif
Until>v_kay=%v_ra_cnt%
//Determines the next script
// by applying rules
//MessageModal>Next item is %v_next_scp%
Assigned>v_next_scp,v_var_assigned
//in case there are more array vars than scripts
Position>v_script_,%v_next_scp%,1,v_string_pos
If>%v_string_pos%>0
Let>v_var_assigned=FALSE
Endif
//Assigned or not, these are first rules
If>v_scp_repeat=REPEAT
Let>v_next_scp=%SCRIPT_DIR%\%SCRIPT_NAME%.scp
Endif
If>v_exe_repeat=REPEAT
Let>v_next_prog=%SCRIPT_DIR%\%SCRIPT_NAME%.exe
Endif
If>v_scp_repeat=END
Let>v_next_scp=%SCRIPT_DIR%\exit.scp
Endif
If>v_exe_repeat=END
Let>v_next_prog=%SCRIPT_DIR%\exit.exe
Endif
//If still not assigned
If>v_var_assigned=FALSE
If>v_scp_repeat=TRAVERSE
Let>v_next_scp=%SCRIPT_DIR%\exit.scp
Endif
If>v_exe_repeat=END
Let>v_next_prog=%SCRIPT_DIR%\exit.exe
Endif
//scp
If>v_scp_repeat=LOOP
Let>v_next_scp=%v_script_1%
Else
Let>v_next_scp=%SCRIPT_DIR%\exit.scp
Endif
//exe
If>v_exe_repeat=LOOP
Let>v_next_prog=%v_prog_1%
Else
Let>v_next_prog=%SCRIPT_DIR%\exit.scp
Endif
Endif
END>NEXT_ONE
The only thing left is to pass the debug variable on the command line instead of hardcoding it.