Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
Mrbrown
- Newbie
- Posts: 5
- Joined: Tue Aug 14, 2007 12:44 am
Post
by Mrbrown » Wed Aug 22, 2007 12:39 am
Hello again,
I encountered a strange problem.
This is the simply code:
Code: Select all
let>incluso1=%script_dir%
ConCat>incluso1,\IdentSimboloNomiPlayerTipoMatch.scp
Include>%incluso1%
The included code is loaded and executed when i normal run the script
but when i run the Debug Step by step "F8" i get the error "file in include does not exist" and the only way for make this include working non the F8 mode is to use after the include the fullpath and file name, without the possibility of using variable.
So, resuming, the isse is that when i normal run the script i can the variable for the include, but in the debug step by step "F8" variable cannot be used, or i get the error "file does not exist".
Any explaination?
Best Regards
-
Me_again
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Post
by Me_again » Wed Aug 22, 2007 12:55 am
Not sure it will fix it but you shouldn't need to ConCat> it, try:
let>incluso1=%script_dir%IdentSimboloNomiPlayerTipoMatch.scp
-
gdyvig
- Automation Wizard
- Posts: 447
- Joined: Fri Jun 27, 2008 7:57 pm
- Location: Seattle, WA
Post
by gdyvig » Wed Oct 29, 2008 11:03 pm
The solution in the previous post did not work for me, but this does:
Let's you have this macro script files:
c:\common\IncludeCommon.scp
c:\suite1\IncludeSuite1.scp
c:\suite1\mymacro.scp contents:
-------------------------------------
Change Directory>%SCRIPT_DIR%
Include>IncludeSuite1.scp
...rest of macro
c:\suite1\IncludeSuite1.scp contents:
--------------------------------------
Let>CommonDir=c:\common
Change Directory>%CommonDir%
Include>IncludeCommon.scp
Change Directory>%SCRIPT_DIR%
Might work for compiled macros also.
Need to check that out.
-
gdyvig
- Automation Wizard
- Posts: 447
- Joined: Fri Jun 27, 2008 7:57 pm
- Location: Seattle, WA
Post
by gdyvig » Thu Oct 30, 2008 3:31 pm
I created an executable using macros like the ones described in my previous post. It successfully included both include macros into the compiled executable.
This method provides greater flexibility for using variables to define the folder locations of your included macros.
-
gdyvig
- Automation Wizard
- Posts: 447
- Joined: Fri Jun 27, 2008 7:57 pm
- Location: Seattle, WA
Post
by gdyvig » Mon Jan 26, 2009 5:32 pm
Hi Marcus,
Section "2.21 Create Exe" in the manual incorrectly states under Options:
Compile Incudes ... Will not work where Include> references scripts via variables other than SCRIPT_DIR.
It should say CWD, not SCRIPT_DIR.
The argument for the Include statement should not contain any variables - it should be a fully qualified scriptname or a partially qualified scriptname under the CWD directory.
Could this correction be made in the next update of the manual? Macro Scheduler's actual behavior is more flexible than the manual suggests.
Thanks,
Gale
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Mon Jan 26, 2009 9:44 pm
Actually it WILL work with SCRIPT_DIR but only when compiling from the main Macro Scheduler window. If compiling from within the editor it will not compile includes that use SCRIPT_DIR. It should work in both cases.
This was reported to me a couple of days ago and we will endeavour to fix.
-
gdyvig
- Automation Wizard
- Posts: 447
- Joined: Fri Jun 27, 2008 7:57 pm
- Location: Seattle, WA
Post
by gdyvig » Tue Jan 27, 2009 1:31 am
After the fix, CWD will still be the Current Working Directory for the include statement?
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Tue Jan 27, 2009 9:59 am
Of course - CWD is always the current working directory for everything. You can't change that. If you don't specify a path then CWD will always be used. And CWD could be anything depending on what the app has done. CWD may change - e.g. it changes when you use Change Directory, but an app you call may also change it.
SCRIPT_DIR is meant to be the only variable Includes can be compiled with. It is the only sensible one you can use as it refers to the directory that the script you are compiling is in. Of course if you haven't yet saved the script it won't have one. The bug is that it isn't quite working within the editor. But it works fine from the main window.