Hi,
trialling software with some work already done by another tool - but his so far more functional - howver getting stuck here..
when x = 1 Bulkorder.scp uses array_1 OK and as input as expected
when x =2 it does not - BUT message modal tells me Array_2 is as expected.. ie same form/structure etc(just a different number)
Im confused!
While>xroutes_%x%routes_%x%
include>C:\scripts\Bulkorder.scp
else>
endif>
let>x=x+1
endwhile>
thanks for any help
if I get this going I think we can use this product from now on
Loop with variable
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I think you need to re-post your code. Use the CODE button to format it.
Also please clarify what you are trying to do.
Also please clarify what you are trying to do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
OK
Not sure about the CODE request
I am trying to loop through an array and pass each array element to the include script
it works OK on the first pass
and this shown by me using the message modal
on the second loop the message modal shows me the second element of the array as expected
but the script fails ands looks to use null?
Not sure about the CODE request
I am trying to loop through an array and pass each array element to the include script
it works OK on the first pass
and this shown by me using the message modal
on the second loop the message modal shows me the second element of the array as expected
but the script fails ands looks to use null?
Ok, now please post your code (including the "include") so that
we can help you debug.
The only reason to use include this way, is if you use the exact same code in more than one macro file.... otherwise it might be better coded as a subroutine (see Gosub and SRT and End in the help file)
After you paste the code into the forum message box, highlight it with the mouse and then press the "Code" button. This adds some formatting tags which makes it easier to read.
The "Code" button is above the message box between the "Quote" and "List" buttons.
It also helps to check the boxes "Disable Smilies in this post" and "Disable HTML in this post"
we can help you debug.
The only reason to use include this way, is if you use the exact same code in more than one macro file.... otherwise it might be better coded as a subroutine (see Gosub and SRT and End in the help file)
After you paste the code into the forum message box, highlight it with the mouse and then press the "Code" button. This adds some formatting tags which makes it easier to read.
The "Code" button is above the message box between the "Quote" and "List" buttons.
It also helps to check the boxes "Disable Smilies in this post" and "Disable HTML in this post"
cheers
I am using 1 include at moment to test the loop - but will trigger more when complete.
[/code]
Code: Select all
let>routes_1=Route1
let>routes_2=Route2
let>routes_3=Route3
let>routes_4=Route4
let>routes_5=Route5
let>x=1
include>C:\scripts\PrepareSupervend.scp
blockinput>0
While>x<3
if>routes_%x%<>0
messagemodal>routes_%x%
include>C:\scripts\Bulkorder.scp
//include>Runsheet.scp
//include>dailyInvoice.scp
//include>deldocks.scp
else>
endif>
let>x=x+1
endwhile>
//Include>C:\scripts\exitSupervendfromreports.scp
BlockInput>0
//include>C:\scripts\pdfmerge.scp
//include>C:\scripts\emailPaperwork.scp