Forum > General

Error: Can't determine which overloaded function to call


Hey Dude's ..

I'm porting one of mine app written in delphi to lazarus, and till now it's going well. I stop here at this problem.

I'm Trying to use the function Pos that probably at .

This is the command that i'm using :

--- Code: ---if Pos(Campo[z],'_')<>0 Then
--- End code ---

In Delphi it goes well. Can somebody tells me where i'm mistaking ?

Version #: beta
Date: 2009-10-25
FPC Version: 2.2.4
SVN Revision: 22279

untfuncoes.pas(466,10) Error: Can't determine which overloaded function to call
untfuncoes.pas(494) Fatal: There were 2 errors compiling module, stopping

In case there is another pos function around in some unit try:
Or what is "Campo"?

I'm from Brazil, a right translation for Campo is Field. This is one of my variables.


I need to check in what position i can found the underline character ( '_' ).

What Theo Said doesn't work. There is no Pos At System.

I Was thinking about change the code to Support the PosEx Function. That one probably will work.

Thanks Theo ...

If someone can help, I appreciate.


 if Pos(Campo[z],'_')<>0 Then

You are searching for the occurrence of a char ( Campo[z] is a char ), in another char ( '_' is a char too; yes it could be treated as a string, but probably is treaded as char).

the error is probably, because pos expects a string as 2nd arg. Maybe a case for the fpc mailing list. Maybe it can be added to the rtl?

Anyway, in your case:
 if Campo[z] = '_' Then


[0] Message Index

Go to full version