I'm hoping to get some help. I recently started using program version 2009.1.400 from April 2009 and now have a problem with the choose function. In previous versions I used a choose statment to convert decimals to fractions and it worked fine. The exact text was:
{Truncate(Subassembly.Width)} {Choose((Subassembly.Width-Truncate(Subassembly.Width))*16,1,1,3,1,5,3,7,1,9,5,11,3,13,7,15,1)}{IIF((Subassembly.Width-Truncate(Subassembly.Width))>1/32,"/","")}{Choose((Subassembly.Width-Truncate(Subassembly.Width))*16,16,8,16,4,16,8,16,2,16,8,16,4,16,8,16)}
As you can see the Choose statement contains the Truncate function which never casued a problem until the newest version. Is this a known problem and does anybody have fix fix for this. I have tried using a calculated column but if any part of what is used in the Choose statment contains the Truncate function it doesn't work. I have tried other math operations and that works fine in the Choose statement just not the Truncate function.
I receive the error "Overload resolution failed because no accessible 'Choose' can be called without a narrowing conversion."
Anyhelp would be great! Thanks in advance!
Problem with Choose Function
Problem with Choose Function
Hi
Could you please send mrt template of that problem report to support[at]stimulsoft.com for analysis?
Thank you.
Could you please send mrt template of that problem report to support[at]stimulsoft.com for analysis?
Thank you.
Problem with Choose Function
Hello,
Please check build from 15 June when it will be available.
Thank you.
Please check build from 15 June when it will be available.
Thank you.
Problem with Choose Function
The 15 June 2009 release did not fix this problem, the code that worked with previous releases, noted above, still does not work with the current release. Below is the result of using a choose and truncate function together.
C:\Documents and Settings\tsmith\Local Settings\Temp\cy5stgtq.0.vb(216,0) : error BC30519: Overload resolution failed because no accessible 'Choose' can be called without a narrowing conversion:
I hope I'm missing something terribly simple any suggestions would be greatly appreciated.
We've rewritten the dumb thing to work but the code is stupidly long .. I've used the Switch function, I wish it was identical to the old Case statement, then we wouldn't have to test each time. I wonder if we can try that ... without the test in each case ... hmm.
{IIF((Truncate(System.Math.Round(CombinedParts.Thickness*32)/32))<1,"",(Truncate(System.Math.Round(CombinedParts.Thickness*32)/32)))} {Switch((Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=31,"31/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=30,"15/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=29,"29/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=28,"7/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=27,"27/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=26,"13/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=25,"25/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=24,"3/4",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=23,"23/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=22,"11/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=21,"21/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=20,"5/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=19,"19/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=18,"9/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=17,"17/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=16,"1/2",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=15,"15/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=14,"7/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=13,"13/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=12,"3/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=11,"11/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=10,"5/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=9,"9/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=8,"1/4",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=7,"7/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=6,"3/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=5,"5/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=4,"1/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=3,"3/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=2,"1/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=1,"1/32")}
C:\Documents and Settings\tsmith\Local Settings\Temp\cy5stgtq.0.vb(216,0) : error BC30519: Overload resolution failed because no accessible 'Choose' can be called without a narrowing conversion:
I hope I'm missing something terribly simple any suggestions would be greatly appreciated.
We've rewritten the dumb thing to work but the code is stupidly long .. I've used the Switch function, I wish it was identical to the old Case statement, then we wouldn't have to test each time. I wonder if we can try that ... without the test in each case ... hmm.
{IIF((Truncate(System.Math.Round(CombinedParts.Thickness*32)/32))<1,"",(Truncate(System.Math.Round(CombinedParts.Thickness*32)/32)))} {Switch((Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=31,"31/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=30,"15/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=29,"29/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=28,"7/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=27,"27/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=26,"13/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=25,"25/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=24,"3/4",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=23,"23/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=22,"11/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=21,"21/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=20,"5/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=19,"19/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=18,"9/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=17,"17/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=16,"1/2",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=15,"15/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=14,"7/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=13,"13/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=12,"3/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=11,"11/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=10,"5/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=9,"9/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=8,"1/4",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=7,"7/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=6,"3/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=5,"5/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=4,"1/8",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=3,"3/32",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=2,"1/16",(Round((CombinedParts.Thickness-Math.Truncate(CombinedParts.Thickness))*32))=1,"1/32")}
Problem with Choose Function
Ok, so I couldn't get past having to write all that dumb code so I found a way around the old code ..
1) Create a new variable be sure to make it Read Only(Check box at bottom), call it W1, Type = int (integer), Default Value = (CombinedParts.Width-Truncate(CombinedParts.Width))*32
2) Delete that section of the original formula and replace it with W1, as follows .. {Choose(W1,"1/32","1/16", etc.
You will have to create a new variable for Length and Thickness. Looks like the key is that the Choose statement required a integer and didn't like getting it through the Truncate function directly.
:waaaht:
1) Create a new variable be sure to make it Read Only(Check box at bottom), call it W1, Type = int (integer), Default Value = (CombinedParts.Width-Truncate(CombinedParts.Width))*32
2) Delete that section of the original formula and replace it with W1, as follows .. {Choose(W1,"1/32","1/16", etc.
You will have to create a new variable for Length and Thickness. Looks like the key is that the Choose statement required a integer and didn't like getting it through the Truncate function directly.
:waaaht:
Problem with Choose Function
Hi
Thank you very much for this feedback.
Thank you very much for this feedback.