PITA_Pan Posted May 12, 2011 Report Share Posted May 12, 2011 I an trying to use the modify decimal command to subtract one decimal variable from another. But I get odd results. Top level macro A contains sub-macro B that populates a decimal variable %DTV% (A decimal time value) Further on in A sub-macro C is called and it in turn has sub-macro D. D uses %DTV% and subtracts another decimal (Called from the registry and parked in %TEMP_REG[%n%]%). The result is placed in %TEMP_DONE[%n%]%. n is incremented and a loop populates n=1 to n=4 Problem is the subtraction gives a strange result: it isn't happening and the result is negative and off by many thousands. What should be 10.789etc. is -40644.789etc. I check A, B, C and D and check that %DTV% is being correctly declared, populated and it is in each macro (Using the debugger). I check %TEMP_REG[%n%]% to make sure it is being populated from the registry correctly and it is. If put macro B (that populates %DTV% in the first place) at the top of macro D so I am creating %DTV% right fresh on the spot then everything works perfectly. Yet the debugger shows the same values for %DTV% and %TEMP_REG[%n%]% no matter how I play it. Only the results in %TEMP_DONE[%n%]% are screwy. <VARIABLE MODIFY DECIMAL Option="\x01" Destination="%TEMP_DONE[%n%]%" Value1="%DTV%" Value2="%TEMP_REG[%n%]%"/> If there is a nesting limit of some sort the debugger isn't showing it---a problem with the calculations? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.