Hi again,
I have detected a problem with the FORMAT command. If I use the FORMAT command in a operation loop like the example, the RAM memory increases 100k every second and in few hours the script ends crashing due to excess of RAM memory. In a normal operation without the FORMAT command the script is stable and continue "forever" without problems:
Let>a=1.34
Let>n=1
Label>INIT
Let>b=4.3%n%
Format>%.2n,{(%a%-%b%)},result
Message>%result%
Let>n=%n%+1
Goto>INIT
Does anybody know why ?
Calculation problem
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1416
- Joined: Sun Nov 03, 2002 3:19 am
Re: Calculation problem
I tried your code and didn't experience any performance issues, so it's difficult to test, but there are two things I might try.
#1. I'm wondering if your use of n as a variable is interfering with the n in format. Format still seems to be working though, so this may be a red herring. See if this is better.
#2. It could simply be a tight loop. Let's see if adding a tiny wait improves things.
It is odd that it only does that if Format is included though. I'm also wondering if b eventually becoming incredibly long might be playing in to this. Please let us know how you get on.
#1. I'm wondering if your use of n as a variable is interfering with the n in format. Format still seems to be working though, so this may be a red herring. See if this is better.
Code: Select all
Let>a=1.34
Let>n=1
Label>INIT
Let>b=4.3%n%
Format>%.2n,{(%a%-%b%)},result
Message>%result%
Let>n=%n%+1
Wait>0.05
Goto>INIT
Code: Select all
Let>a=1.34
Let>z=1
Label>INIT
Let>b=4.3%z%
Format>%.2n,{(%a%-%b%)},result
Message>%result%
Let>z=%z%+1
Goto>INIT
Re: Calculation problem
Hi again Dorian,
I need to execute the script without "Wait>". The problem doesn't depend of the increase of "n", it occurs in a loop without increase of "n" value too. If you check the [Task_Manager] you can see this increase of RAM memory in the "msched.exe" process [More or Less, +100k every second]. If instead of use the FORMAT command you use the "FormatNumber" command of [VBA], the RAM memory is stable and It doesn't increase.
Let>a=1.34
Let>n=1
Label>INIT
Let>b=4.3%n%
VBEval>FormatNumber(%a%-%b%),result
Message>%result%
Let>n=%n%+1
Goto>INIT
This combination using "VBEval>FormatNumber" works correctly and the RAM memory is stable.
Thanks equally for your answer !!!
I need to execute the script without "Wait>". The problem doesn't depend of the increase of "n", it occurs in a loop without increase of "n" value too. If you check the [Task_Manager] you can see this increase of RAM memory in the "msched.exe" process [More or Less, +100k every second]. If instead of use the FORMAT command you use the "FormatNumber" command of [VBA], the RAM memory is stable and It doesn't increase.
Let>a=1.34
Let>n=1
Label>INIT
Let>b=4.3%n%
VBEval>FormatNumber(%a%-%b%),result
Message>%result%
Let>n=%n%+1
Goto>INIT
This combination using "VBEval>FormatNumber" works correctly and the RAM memory is stable.
Thanks equally for your answer !!!

- Dorian (MJT support)
- Automation Wizard
- Posts: 1416
- Joined: Sun Nov 03, 2002 3:19 am
Re: Calculation problem
I see exactly what you mean. Thank you for bringing this to our attention. We've added it to the list of things for dev to look at.