Forum Discussion
JeanL
15 years agoContributor
Hi Jared,
yeah I found that from Google too and tried that Vbscript code, but it gives me error (coordinates were out of bounds or something like that). I don't know about JScript code. And I noticed that Vbscript code had some differences with that JScript code.
Indexes coord and i are increased at the beginning of the loop when in JScript loop they are increased at the end of the loop.
So in example Vbscrpt index i value would be 1 on the first loop (the inner loop) when in JScripts index i value would be 0 on the first loop. But anyhow that wasn't the part that was causing errors, just noticed the slight difference between these codes.
yeah I found that from Google too and tried that Vbscript code, but it gives me error (coordinates were out of bounds or something like that). I don't know about JScript code. And I noticed that Vbscript code had some differences with that JScript code.
Do While coord < obj.Left + obj.Width
coord=coord+1
i=0
Do While i < lineWidth
i=i+1
ScreenShot.Pixels(coord, obj.Top + i) = color
ScreenShot.Pixels(coord, obj.Top + obj.Height - i) = color
Loop
Loop
Indexes coord and i are increased at the beginning of the loop when in JScript loop they are increased at the end of the loop.
for(var coord = obj.Left; coord < obj.Left + obj.Width; coord++)
{
for(var i = 0; i < lineWidth; i++)
{
pic.Pixels(coord, obj.Top + i) = color;
pic.Pixels(coord, obj.Top + obj.Height - i) = color;
}
}
So in example Vbscrpt index i value would be 1 on the first loop (the inner loop) when in JScripts index i value would be 0 on the first loop. But anyhow that wasn't the part that was causing errors, just noticed the slight difference between these codes.