Generate code into Window Resizer

Hi all,

I need to generate code into a Window Resizer method.

The “Create AT from Embed” creates this:

#AT(%ResizerMethodCodeSection,%ActiveTemplateInstance,‘WindowResizeEnd’,‘()’),PRIORITY(5000)

But nothing is generated into the method. I tried:

#AT(%ResizerMethodCodeSection,‘WindowResizeEnd’,‘()’),PRIORITY(5000)

with the same results.

I have some old templates that generate into the INIT method of the resizer that work fine, so I’m not sure what the issue is with this embed.

Anyone have an idea how to make this work?

Best regards,
Arnor

Try;

#AT(%ResizerMethodCodeSection,,'WindowResizeEnd','()'),PRIORITY(4500)

The %ActiveTemplateInstance parameter was your problem, since it uses the number for your template there, not the number for the resizer template. Since there can only be one resizer template anyway, you can simply omit it.

Hi Bruce,

Thanks for the suggestion, but I had tried that when I posted, but forgot to mention it, and it didn’t work, but maybe I didn’t do it right… I just tested it and it DOES work.

I found code in an old template of mine that worked:

#ATSTART
#DECLARE(%ResizeInstance)
  #FOR(%ActiveTemplate),Where(%ActiveTemplate='WindowResize(ABC)')
    #FOR(%ActiveTemplateInstance)
      #SET(%ResizeInstance,%ActiveTemplateInstance)
      #BREAK
    #ENDFOR
  #ENDFOR
#ENDAT

Then use the %ResizeInstance for the Instance parameter of the #AT. That worked perfectly :slight_smile:

Best regards,
Arnor

Yes, that would be the apprach to use if you needed the instance number. (But in this case you dont :grinning_face: )

Hi Bruce,

Yep. I’m pretty sure this code originated back in C6, maybe it wouldn’t accept an omitted parameter? Probably 20+ years old, so I have no idea any more

Best regards,