Form Callback Not Working

I am trying to create a form and the callback function doesn't seem to be working (see below). I keep getting an error msg : (2,779)   Method <FORM>.XXX() not found

What is wrong with it ?

Note : I load and show the form by :

$m 'C:\ABC\LabelForm.pmlfrm'
show !!Labelform

Button  .GensecTog at x1 ymax+0.2 | All / None | callback | !this.xxx() | width 10

define method .xxx()

    $P 'XXX'

endmethod

Any help is appreciated

  • Hi,

    You are trying to call your Form as a macro (with a $m).
    This is a practice sometimes used, combined with a "show" command, but it should be avoided.

    The good practice is to have your Form stored in your PMLLIB, and then simply opened with a "show" command.
    By doing this, your "xxx" method will be correctly found.

  • I suspected that might have been the case

    I don't like to store my things in PMLLIB (and using rehash all) as it's my own personal stuff and don't want to mix it in with company areas. If I could just leave the files in PMLLIB then that might be ok, but having to do the rehash all, what's that all about. Strange concept. Can they be in a sub directory of PMLLIB ? DO I have to do a pml rehash all ?

    I really don't like the way Aveva make you use it like this. I've done loads of programming in other software such as Autocad and there is never that restriction. You can store your files anywhere you want and load it with no issues giving you ultimate flexibility. I also notice you can't have multiple functions within one file, so potentially you end up with lots of files for one program. Anyway I guess it is what it is

    Thanks for your response !

  • You should be able to get by with the native operation of PMLLIB.

    Here are some ideas:
    - Create a "Dev" E3D launcher which behaves like the launcher you already use, but adding a value to the PMLLIB in the folder of your choice (e.g. set PMLLIB=%YourLocalPMLLIB%;%PMLLIB%)
    - Store your personal codes in the PMLLIB of your installation (e.g. C:\AVEVA\E3D\3.1.0\PMLLIB). Be careful, this is not ideal because in the event of a new installation you could lose your files.

    To answer your questions, yes you can use a PMLLIB subfolder to place your files.
    The PML REHASH ALL command will go through all folders and subfolders to index the PML files found under your directories declared in the PMLLIB environment variable.
    Unless there is a specific reason not to do so, you can use the PML REHASH ALL command without fear. It will update the pml.index file of your local PMLLIB without impacting the pml.index of the shared PMLLIB.