Hallo Martin,

Du schriebst am Wed, 13 Nov 2013 17:23:27 +0100:

> On Wednesday 13 November 2013 16:42:03 Michael Schnell wrote:
> > if Strings are zero based pos() will issue a 0 if he second string
> > starts with the first one.
> >
> > Supposedly it will issue -1 if there is no match.
> >
> Probably.

Not neccessarily.

> > While I do like this behavior, it is very incompatible with any existing
> > Pascal dialect, where you do "if pos() = 0" to check if a string is
> > contained in another.
> >
> True.

You could also decide to make "pos" take a return variable parameter for
the position, as this would nearly always be neccessary. Its return value
would then be a boolean, indicating whether the substring was found. You
might provide an overloaded version without the return variable paramter
for the rare case where you just want to check for _presence_, but are not
interested in the _position_ itself. And maybe, an overloaded version also
for compatibility that returns an ordinalized boolean result (for uses as
shown above).

-- 
-- 
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------



------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to