Page MenuHomeFeedback Tracker

[Feature Request] preProcessor Command: __FILE_Short__
Feedback, NormalPublic

Description

the current PreProcessor Command __FILE__ is a great, but sadly, it also provides the full path to the file itself.
like this: z\storm\addons\based\functions\fn_cba_settings_initialized.sqf

Instead, i would expect, and hope for, an alternative command which only provides the actual filename, potentially even without the .sqf ending.

since renaming an existing command into __Filepath__
is most likely out of the question, so therefore i'd like to propose __FILE_SHORT__ or __FILE_NAME__ as a new preProcessor Command which would produce a short version of the filename, in this example fn_cba_settings_initialized.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

mrzorn created this task.Mar 30 2024, 5:24 PM
dedmen added a subscriber: dedmen.Thu, Apr 4, 12:57 PM

I think the file extension in there would still make sense, because script files don't need to end in .sqf
But that matters so rarely, it might make sense to split it into a second definition?

mrzorn added a comment.EditedThu, Apr 4, 3:49 PM

i prefer to keep it short, but if someone needs the file ending, a 2. variant doesnt hurt

__FILE_SHORT__ -> fn_cba_settings_initialized.sqf
__FILE_SHORTER__ -> fn_cba_settings_initialized

or

__FILE_NAME__ -> fn_cba_settings_initialized.sqf
__FILE_SHORT__ -> fn_cba_settings_initialized

but even if its just a single additonal command like,
__FILE_NAME__ -> fn_cba_settings_initialized.sqf, then its still an improvement over the current sitaution

__FILE_NAME__
__FILE_SHORT__
"file1.sqf"
"file1"

2.18

dedmen changed the task status from New to Feedback.Thu, Apr 25, 2:32 PM