[Implemented] mid(text$,pos)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] mid(text$,pos)

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

Now i must write

mid(text$,pos,len(text$)-pos)

but other BASIC-Languages use for it

mid(text$,pos)

Would be nice.

Thanks

GPI



PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.
but other BASIC-Languages use for it

mid(text$,pos)
But, how does it work if you dont want to extract until the end of the line?

Mid("1 2 3",3,1) will extract the number 2

i cant understan with your whish how can i extract just one character.

Sorry if im saying something stupid : )



Best Regards

Ricardo

Dont cry for me Argentina...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by mdkrsta.

how 'bout Right(text$,pos)?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

@ricardo
for example:
MID("1 2 3",3) will return "2 3"

@mdkrsta
doesn't work! You must write
Right(Text$,len(text$)-pos)

mid(Text$,pos) is shorter and most of the other BASIC use it.

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Revolver.

I think he means he wants the last argument to be optional. That's how most other basic languages that I know of have it. Such as Mid("asdf",2,1) will return "s", whereas Mid("asdf",2) will return "sdf".

Result$ = Mid(String$,StartPosition[,Length])
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Ok, I will improve it.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Thanks Fred , i realy like this improvement :)

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by geoff.

Thanks Fred , so do I :)

Geoff
Post Reply