Latest versions
...
Menu  Language: fr
Search




Articles & Documents

Close Tutorials

Preferences

Connect again
---

Your name (or pseudo) :

Your secret code (associated with your pseudo)


 Count of members 409 members


Connected :

(nobody)
CPDB.Net

Friends News
Google Ads
Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
23 Subscribers
Webmaster - Infos
Visits

   visitors

   visitors online

Pagerank
forum.gifForum - ppCompiler [EN] - Topic #39

Forum - Forum
ppCompiler [EN] - ppCompiler [EN]


active  Topic # 39  StrStr Function

14/09/2011 @ 11:09
by DearJohn

Anonymous



In the "stringscommented.pas" collection I found this nice function:

function StrPosRelative(const Str, Token: String):UInt8;
var
 lvar1, lvar2: tPIS;
begin
 lvar1.recPtr:=StrStr(Str, Token);
 lvar2.recPtr:=@Str;
 StrPosRelative:=lvar1.recInt-lvar2.recInt;
end;

Unfortunately I couldn't find the "StrStr" function in any library.

Do you have any hint for me to use this function?

Regards, Reinhard.

Write to DearJohn   Post an answer  Top
Answer n 1
--------
15/09/2011 @ 22:03
by Pierre

Anonymous


Hi !

I found these references into my old PP and naPP API tables :

PP 68k
function StrStr(const str,token:String):StringPtr; inline(SYSTRAP,$A0CD); // PP with   SYSTRAP = $4E4F;

naPP (native ARM)
function StrStr    (const str, token:string):stringptr;inline($E519C008,$E1A0E00F,$E59CF7B8);//naPP full arm

If your still in trouble with these functions, I thing you can find an equivalent function into the free Pascal sources.

Have fun

Pierre, south of France, 22h05 and 27C... glass of wine.
Write to Pierre   Post an answer  Top
Answer n 2
--------
16/09/2011 @ 12:35
by DearJohn

Anonymous


Perfect, Thanks! 10 times faster than my own created procedure for that.

Best Regards. Reinhard.

Write to DearJohn   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 




^ Top ^