Skip to content

Fixed CRTDUPOBJ and italian translation#2966

Merged
sebjulliand merged 2 commits intocodefori:masterfrom
buzzia2001:FixCopySRCPF
Nov 14, 2025
Merged

Fixed CRTDUPOBJ and italian translation#2966
sebjulliand merged 2 commits intocodefori:masterfrom
buzzia2001:FixCopySRCPF

Conversation

@buzzia2001
Copy link
Copy Markdown
Contributor

Changes

Fixed CRTDUPOBJ command when an object is duplicated

How to test this PR

When now you duplicate a *FILE object, now all data will be duplicated. For instance, if you duplicate a SRCPF now members will have also source statements.
Also fixed a typo in the italian translation

@sebjulliand sebjulliand self-requested a review November 14, 2025 07:26
@sebjulliand sebjulliand self-assigned this Nov 14, 2025
@sebjulliand sebjulliand added the bug A confirmed issue when something isn't working as intended label Nov 14, 2025
Copy link
Copy Markdown
Member

@sebjulliand sebjulliand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one @buzzia2001 , thank you!
The logic is OK, but see my comment about the code.

Comment on lines +1214 to +1220
if(node.object.type.toLocaleLowerCase() === `*lib`){
command= `CPYLIB FROMLIB(${oldObject}) TOLIB(${newObject})`;
} else if(node.object.type.toLocaleLowerCase() === `*file`){
command=`CRTDUPOBJ OBJ(${oldObject}) FROMLIB(${oldLibrary}) OBJTYPE(${node.object.type}) TOLIB(${newLibrary}) NEWOBJ(${newObject}) DATA(*YES)`
} else {
command=`CRTDUPOBJ OBJ(${oldObject}) FROMLIB(${oldLibrary}) OBJTYPE(${node.object.type}) TOLIB(${newLibrary}) NEWOBJ(${newObject})`
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is good! However, you can avoid repeating code and keep it concise.

Suggested change
if(node.object.type.toLocaleLowerCase() === `*lib`){
command= `CPYLIB FROMLIB(${oldObject}) TOLIB(${newObject})`;
} else if(node.object.type.toLocaleLowerCase() === `*file`){
command=`CRTDUPOBJ OBJ(${oldObject}) FROMLIB(${oldLibrary}) OBJTYPE(${node.object.type}) TOLIB(${newLibrary}) NEWOBJ(${newObject}) DATA(*YES)`
} else {
command=`CRTDUPOBJ OBJ(${oldObject}) FROMLIB(${oldLibrary}) OBJTYPE(${node.object.type}) TOLIB(${newLibrary}) NEWOBJ(${newObject})`
}
const type = node.object.type.toLocaleLowerCase();
if(type === `*lib`){
command = `CPYLIB FROMLIB(${oldObject}) TOLIB(${newObject})`;
} else {
command = `CRTDUPOBJ OBJ(${oldObject}) FROMLIB(${oldLibrary}) OBJTYPE(${node.object.type}) TOLIB(${newLibrary}) NEWOBJ(${newObject})${type === '*file' ? ' DATA(*YES)' : ''}`
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao Seb,
fix as suggested!
Thank you

@sebjulliand sebjulliand merged commit ad390d9 into codefori:master Nov 14, 2025
1 check passed
@sebjulliand
Copy link
Copy Markdown
Member

Thanks @buzzia2001 !

@buzzia2001 buzzia2001 deleted the FixCopySRCPF branch January 24, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A confirmed issue when something isn't working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants