Author Topic: BcxSplitPath  (Read 649 times)

mekanixx

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
BcxSplitPath
« on: April 23, 2023, 04:08:14 PM »
Hi folks,

Could we get an option for BcxSplitPath to drop the "." when returning FEXT? I'm using this quite a bit and following with a line to remove the "." is getting old! :)

Not to mention when I forget that last line!

Code: [Select]
ext$ = BCXSPLITPATH$(filename$, FEXT)
IF INSTR(ext$, ".") THEN REMOVE "." FROM ext$

Something like:

Code: [Select]
BCXSPLITPATH$(filename$, FEXT [, bRemove])
where if bRemove is TRUE/FALSE (or 1/0) to remove the "." or keep as is.

If not I might have a crack at it but you guys know c way better than I do.

Thanks,
Doyle




MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2039
    • View Profile
Re: BcxSplitPath
« Reply #1 on: April 23, 2023, 05:06:02 PM »
Why not this?

DIM Filename$, ext$

Filename$ = "C:\Temp\MyDocument.Dot.Mac"

ext$ =  MID$(BCXSPLITPATH$(Filename$, FEXT), 2)

PRINT ext$

PAUSE

mekanixx

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: BcxSplitPath
« Reply #2 on: April 23, 2023, 08:04:04 PM »
Why not this?

DIM Filename$, ext$

Filename$ = "C:\Temp\MyDocument.Dot.Mac"

ext$ =  MID$(BCXSPLITPATH$(Filename$, FEXT), 2)

PRINT ext$

PAUSE

Yeah, that looks like it'll work fine.

Thanks,
Doyle