August 8, 200421 yr Check this out : Where "Index" = 3 FM 6 : 10^((Index-1)*7) WORKS! = Returns "100,000,000,000,000" FM 7 : 10^((Index-1)*7) FAILS! = Returns "1.0e+14" FM 7 : 9^((Index-1)*7) WORKS = Returns "22,876,792,454,961" Are there any maths bofins out there who understand why it no longer works in FM 7?
August 9, 200421 yr 1.0e+14 is scientific notation for 100,000,000,000,000. You can change the formatting on your layout to choose how it displays.
August 9, 200421 yr Author Hey Shadow, thanks, I get the reasoning for the resulting formula, I just don't understand WHY FM is behaving like a $1 two battery calculator and freaking out after the 13th digit, I can actually get it to DISPLAY the 100,000,000,000,000 , BUT when you click IN that field up comes "1.0e+14", and this thing worked perfectly in FM 6? The whole formula is used to generate "0" 's so I can substitute them with blank spaces ( " " ) to emulate tabs in a report that must stack or indent hierarchically. i.e. Where Index Level = 3 Substitute(Right(10^((Index Level - 1)*7) ; ((Index Level - 1)*7)) ; "0";" ") and 10^((Index Level - 1)*7 returns 1.0e+14 (AND SHOULD BE 100,000,000,000,000) but 9^((Index Level - 1)*7 returns 22,876,792,454,961 can you dig . . . PS and I AM using FM 7.0.2.....
August 9, 200421 yr Why don't you use simple spaces, varying the number according to the index level?
August 9, 200421 yr Author (sigh) I suppose there ARE other ways around this problem it's just that I get stuck on 'why the world is not a perfect place' sometimes and FM 7 is SUPPOSED to work it out like FM 6 did, besides I use it this way 'cos I need a LOT of spaces to fleshing out the number to a power and then converting the "0" 's BACK to spaces . . .
August 9, 200421 yr Do you have FM Developer 7, if so you could write a simple Custom Function to return a text string of spaces of whatever length you liked. One I have written is given below, it is called "RepeatingString" and takes 2 parameters (Character; StringLength), and basically returns the "Character" repeated "StringLength" number of times, just use the following calc If ( (Length ( Character ) = 1) and (GetAsNumber ( StringLength ) = StringLength) and (StringLength > 0) ; Character & RepeatingString ( Character ; StringLength - 1 ) ; "" ) Note the function checks that the Character is of length 1, and that the StringLength is a number greater than 0. The function is recursive and so calls itself until it can return the right answer, generally I've found this to work very efficiently. You would use Set Field ["ListOfSpaces"; "RepeatingString(" "; Index)"] Or even use this to write your own "RepeatingSpaces(NoOfSpaces)" function Matt
Create an account or sign in to comment