Page 1 of 1

[Implemented] mid(text$,pos)

Posted: Tue Feb 11, 2003 11:41 am
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

Posted: Tue Feb 11, 2003 5:37 pm
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...

Posted: Tue Feb 11, 2003 6:56 pm
by BackupUser
Restored from previous forum. Originally posted by mdkrsta.

how 'bout Right(text$,pos)?

Posted: Tue Feb 11, 2003 8:03 pm
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

Posted: Wed Feb 12, 2003 12:01 am
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])

Posted: Wed Feb 12, 2003 8:18 am
by BackupUser
Restored from previous forum. Originally posted by fred.

Ok, I will improve it.

Fred - AlphaSND

Posted: Wed Feb 12, 2003 9:50 am
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

Posted: Wed Feb 12, 2003 11:37 am
by BackupUser
Restored from previous forum. Originally posted by geoff.

Thanks Fred , so do I :)

Geoff