suggestion: Mid() with optional Length-Param

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

suggestion: Mid() with optional Length-Param

Post by AL90 »

I think it is better when the Length-Parameter is optionaly.
In all the other Basics like BB and so on it is standard.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: suggestion: Mid() with optional Length-Param

Post by chris319 »

AL90 wrote:I think it is better when the Length-Parameter is optionaly.
In all the other Basics like BB and so on it is standard.
Agreed.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: suggestion: Mid() with optional Length-Param

Post by PB »

Also agreed, and it's been requested MANY times with no result so far. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Your wish is my command ..

Code: Select all

Macro MidStr(str, start, chars = 0)
  Mid(str, start,  Len(str) * (Not chars)  + chars ) 
EndMacro

Debug MidStr("ABCDEFG",2,2)
Debug MidStr("ABCDEFG",2)
:twisted:


Actually, I too would love a Mid with an optional third parameter. So I 4th the request.
@}--`--,-- A rose by any other name ..
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Post by AL90 »

So i hope Fred will it do to change it. :?:
Post Reply