question

Cameron Seams avatar image
0 Likes"
Cameron Seams asked Mischa Spelt edited

Issue with new item.type syntax in 2017

Hi,

I am changing the syntax of item.type in the SET ITEM TYPE BY PERCENT code to setitemtype(item,2). Once I alter the code, it keeps reverting back to item.type. How do I avoid this? Code is below.

Original Code:

int stream = /**\nStream number:*//***tag:stream*//**/0/**/;
double randomnum = uniform(0.0, 100.0, stream);
double total = 0.0;
int foundmatch = 0;
total += /**\nPercent: *//**/Percent/**/;
if (!foundmatch && randomnum <= total)
{ item.type = /** Type: *//**/2/**/;
foundmatch = 1; }
New Code:
total += /**\nPercent: *//**/Percent/**/;
if (!foundmatch && randomnum <= total) {
setitemtype(item,2);
foundmatch = 1; }
Choose One
custom codeitem typepercentage
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Phil BoBo avatar image
2 Likes"
Phil BoBo answered Cameron Seams commented

It reverts back if you edit it using the popup:

The popup is populated based on the markup in the code. It then generates the appropriate code based on the popup.

If you want to customize the code in the picklist, you can press this button to delete the markup and its features:


popup.png (3.3 KiB)
popup2.png (13.7 KiB)
clear-markup.png (30.4 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Cameron Seams avatar image Cameron Seams commented ·

Thank you @phil.bobo

I needed to delete the markup and its features. I appreciate the help.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.