Bug or feature : build program overwrites code during module

Posted by cverbiest on 10-Mar-2016 08:28

I recently started using the "build program" option of code subtypes.

I now notice that files that are loaded during module load are overwritten by the contents of the template.

Is it normal that the build program executes for existing sources that are loaded as new objects ?

Posted by Jeff Ledbetter on 10-Mar-2016 09:24

Thank you for sharing Carl. I hope that others are inspired to make their own build programs.

It occurred to me that you could add a SEARCH statement in your build program and NOT do the copy if the physical file already exists to work around your original issue with Module Load.

All Replies

Posted by Jeff Ledbetter on 10-Mar-2016 08:52

Hmm.. probably a bug if that is happening. The build programs formerly only ran on the client but we enabled server-side in 11.something.  This could be a scenario that was not tested.  A quick glance at the code tells me that it looks possible. We can definitely try to dupe and log it.

Posted by cverbiest on 10-Mar-2016 09:05

Could'nt find the attach option, this is the build program I'm using

/*
 ____  _   _       ____        _ _     _   ____                         _
|  _ \| |_| |__   | __ ) _   _(_) | __| | |  _ \ _ __ ___   ___ ___  __| |_   _ _ __ ___
| |_) | __| '_ \  |  _ \| | | | | |/ _` | | |_) | '__/ _ \ / __/ _ \/ _` | | | | '__/ _ \
|  _ <| |_| |_) | | |_) | |_| | | | (_| | |  __/| | | (_) | (_|  __/ (_| | |_| | | |  __/
|_| \_\\__|_.__/  |____/ \__,_|_|_|\__,_| |_|   |_|  \___/ \___\___|\__,_|\__,_|_|  \___|

*/
define input parameter Object_Name as Character no-undo. /* The object name.  */
define input parameter Parts_List as Character no-undo. /* Comma-delimited list of part identifiers.  */
define input parameter Part_Descriptions as Character no-undo. /* Comma-delimited list of part descriptions.  */
define input parameter Part_Pathnames as Character no-undo. /* Comma-delimited list of full pathnames to parts.  */
define input parameter Part_Names as Character no-undo. /* Comma-delimited list of part names (no paths).  */
define input parameter Part_Templates as Character no-undo. /* Comma-delimited list of part templates.  */
define input parameter Number_of_Parts as Integer no-undo. /* Number of parts for specified object.  */
define input parameter Code_Subtype as Character no-undo. /* Code Subtype of specified part.  */
define input parameter User_ID as Character no-undo. /* User ID of calling session.  */
define input parameter Task_Number as Integer no-undo. /* Selected task number.  */
define input parameter Task_Summary as Character no-undo. /* Summary of specified task._ */
define input parameter Roundtable_PROPATH as Character no-undo. /* Roundtable startup PROPATH.  */
define input parameter Workspace_Path as Character no-undo. /* Selected Workspace path.  */
define input parameter Workspace_Module_Directory as Character no-undo. /* Workspace module source directory.  */

do on error undo, leave:
    if opsys = "UNIX"
    then do:
        Part_Pathnames = replace(Part_Pathnames, "W:", "/usr2").
        Part_Templates = replace(Part_Templates, "W:", "/usr2").
        Workspace_Path = replace(Workspace_Path, "W:", "/usr2").
    end.
    os-copy value(Part_Templates) value(entry(1, Part_Pathnames)).

    catch e as progress.lang.error:
    message
       e:getmessage(1) skip
        "Object_Name" Object_Name skip
        "Parts_List" Parts_List skip
        "Part_Descriptions" Part_Descriptions skip
        "Part_Pathnames" Part_Pathnames skip
        "Part_Names" Part_Names skip
        "Part_Templates" Part_Templates skip
        "Number_of_Parts" Number_of_Parts skip
        "Code_Subtype" Code_Subtype skip
        "User_ID" User_ID skip
        "Task_Number" Task_Number skip
        "Task_Summary" Task_Summary skip
         "Roundtable_PROPATH" Roundtable_PROPATH skip
        "Workspace_Path" Workspace_Path skip
        "Workspace_Module_Directory" Workspace_Module_Directory skip
        view-as alert-box error.
     end catch.
 end.

Posted by Jeff Ledbetter on 10-Mar-2016 09:24

Thank you for sharing Carl. I hope that others are inspired to make their own build programs.

It occurred to me that you could add a SEARCH statement in your build program and NOT do the copy if the physical file already exists to work around your original issue with Module Load.

This thread is closed