Page 2 of 2

Posted: Mon Dec 26, 2005 2:13 pm
by Killswitch
Jesus, why are all of you producing such complicated solutions:

Code: Select all

String.s="aftershave"
Debug mid(String,findstring(String,"shave",1),len(String))

Posted: Mon Dec 26, 2005 2:30 pm
by PB
Killswitch wrote:Jesus, why are all of you producing such complicated solutions:

Code: Select all

String.s="aftershave"
Debug mid(String,findstring(String,"shave",1),len(String))
Because your solution doesn't cover both his scenarios. :twisted:

Posted: Mon Dec 26, 2005 2:31 pm
by Trond
Killswitch wrote:Jesus, why are all of you producing such complicated solutions:

Code: Select all

String.s="aftershave"
Debug mid(String,findstring(String,"shave",1),len(String))
Why is that less complicated than this?

Code: Select all

String.s = "aftershave"
Debug PeekS(@String.s+Len("shave"))

Posted: Mon Dec 26, 2005 4:03 pm
by Joakim Christiansen
:lol:

Posted: Mon Dec 26, 2005 4:12 pm
by okasvi
Trond wrote:
Killswitch wrote:Jesus, why are all of you producing such complicated solutions:

Code: Select all

String.s="aftershave"
Debug mid(String,findstring(String,"shave",1),len(String))
Why is that less complicated than this?

Code: Select all

String.s = "aftershave"
Debug PeekS(@String.s+Len("shave"))

because of
PeekS()

Syntax

Text$ = PeekS(*MemoryBuffer [, Length])
Description

For advanced programmers only. Very useful to catch a string at the specified memory address. The string should be ended by a '0' character, else it will read the memory until a '0' is encounter. An optional length parameter (in bytes) can be specified.
Supported OS

All

Posted: Mon Dec 26, 2005 4:33 pm
by Trond
Advanced but simple.

Posted: Mon Dec 26, 2005 4:48 pm
by josku_x
Well, atleast you all get the same result :lol: