Forum > General
Error: Can't determine which overloaded function to call
(1/1)
geanmyboy:
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 systemh.inc .
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 #: 0.9.28.2 beta
Date: 2009-10-25
FPC Version: 2.2.4
SVN Revision: 22279
I386-win32-win32/win64
untfuncoes.pas(466,10) Error: Can't determine which overloaded function to call
untfuncoes.pas(494) Fatal: There were 2 errors compiling module, stopping
theo:
In case there is another pos function around in some unit try:
System.Pos();
Or what is "Campo"?
geanmyboy:
I'm from Brazil, a right translation for Campo is Field. This is one of my variables.
Campo:String;
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.
[]'s
Martin_fr:
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
Navigation
[0] Message Index