<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Folks.<br>
<br>
I don't know how Jeppe is playing around but because I want to make
sure FPC works preoperly I decided to take some time to see what
happens<br>
Yhis is the code snippet I use in Win32 and Linux x86_64<br>
All are Lazaur 1.0.8<br>
<br>
Put the code under a TButton and send results to a TMemo:<br>
<br>
procedure TFrmMain.BtnTestClick(Sender: TObject);<br>
var<br>
P: Integer;<br>
str: String;<br>
pc: PChar;<br>
len: Integer;<br>
begin<br>
str :=
'<a class="moz-txt-link-freetext" href="http://bcms.webdev.tralala.com/testudf.php?action=goodanswer">http://bcms.webdev.tralala.com/testudf.php?action=goodanswer</a>';<br>
len := Length(str);<br>
P := PosEx('bcms', str, 3);<br>
Memo1.Lines.Add(Format('search "bcms" in %s: position %d', [str,
P]));<br>
pc := nil;<br>
ReAllocMem(pc, len + 1);<br>
Move(PChar(str)^, pc^, len);<br>
pc[len] := #0;<br>
P := PosEx('bcms', pc, 3);<br>
Memo1.Lines.Add(Format('search "bcms" in %s: position %d', [str,
P]));<br>
end;<br>
<br>
I've made the test with a PChar too<br>
<br>
TMemo.Lines shows:<br>
search "bcms" in
<a class="moz-txt-link-freetext" href="http://bcms.webdev.tralala.com/testudf.php?action=goodanswer">http://bcms.webdev.tralala.com/testudf.php?action=goodanswer</a>:
position 8<br>
search "bcms" in
<a class="moz-txt-link-freetext" href="http://bcms.webdev.tralala.com/testudf.php?action=goodanswer">http://bcms.webdev.tralala.com/testudf.php?action=goodanswer</a>:
position 8<br>
<br>
which, obviously looks correct. That's what I expect since more than
15 years (beginning with Delphi and Pos function)<br>
<br>
Enjoy,<br>
<br>
Antonio.<br>
-- <br>
<div class="moz-signature">
<table
style="font-family:'Calibri','sans-serif';font-size:8.0pt;color:#002f87;border:0;width:auto;">
<tbody>
<tr>
<td style="vertical-align:bottom;padding:40px 20px
25px;border-top:1pt solid #BFBFBF;"> <img alt="Sita
Software"
src="cid:part1.04070004.01050407@sitasoftware.lu"> </td>
</tr>
<tr>
<td style="vertical-align: top; padding: 5px 20px 0;"> <b>Antonio
Fortuny</b><br>
Senior Software engineer<br>
<br>
220, avenue de la Liberté<br>
L-4602 Niederkorn<br>
Tel.: +352 58 00 93 - 93<br>
<a style="color:#002f87;cursor:pointer;text-decoration:
none;" href="http://www.sitasoftware.lu">www.sitasoftware.lu</a><br>
</td>
</tr>
<tr>
<td style="padding:20px 20px 30px;border-bottom: 1pt solid
#BFBFBF;" align="right"> <img alt="Your IT Partner"
src="cid:part3.08090705.01010300@sitasoftware.lu"> </td>
</tr>
</tbody>
</table>
</div>
</body>
</html>