Page 1 of 1

File Path Concatenation

Posted: Wed Jan 31, 2018 6:19 am
by jyoung
Is there a function, intrinsic or something that can concatenate file paths with the correct slashes for Windows and IBMi, kinda like how .NET's Path.Combine works?

I find myself doing this alot

Code: Select all

if (*OSAPI = IBMI)
#templatePath := 'templates/PTOTemplate.xlsx'
else
#templatePath := 'templates\PTOTemplate.xlsx'
endif
I could easily make something to handle it, but would rather use things that are baked into LANSA instead of rolling my own.

Re: File Path Concatenation

Posted: Wed Jan 31, 2018 7:58 am
by Stewart Marshall
Hi Joe

If I recall correctly, the *PATHDELIM system variable will solve your problem

#templatePath := 'templates' + *PATHDELIM + 'PTOTemplate.xlsx'


Regards