Getting __COLUMN__ of source code location.

IchorDev zxinsworld at gmail.com
Thu Jul 27 16:17:28 UTC 2023


I'm not aware of any way to do that exact thing. Measuring what 
column a line is on would be quite subjective. How wide is a tab 
space? Technically, it could be any number of columns depending 
on the display configuration used.

On Sunday, 23 July 2023 at 15:01:51 UTC, realhet wrote:
> Why is this important?
> - I have an immediate GUI which is using this __MODULE__LINE__ 
> data to generate a unique ID. And I must put every GUI control 
> creation command on a different line or provide a unique ID 
> manually.

But you'd have to provide a unique ID manually anyway if, for 
instance, you create UI elements in a for loop:
```d
for(size_t i=0; i<10; i++){
	button();
}
```

I'd suggest using something more like Dear ImGui's ID system 
instead.


More information about the Digitalmars-d-learn mailing list