Error message on Return "StrComp(f.NativePath = g.NativePath, 0)"

I’m trying to convert code in "Designing a Recent Items Submenu, By Charles Yeomans " to what I use.
There is an older version of StrComp using this code:

Protected Function Equals(f as FolderItem, g as FolderItem) as Boolean If f <> nil and g <> nil then #if targetMacOS Return (f.MacVRefNum = g.MacVRefNum) and (f.NativePath = g.NativePath) and (f.name = g.name) #endif #if targetWin32 Return StrComp(f.NativePath = g.NativePath, 0) #endif Else Return false End if End Function

I want to convert it to simply:

Protected Function Equals(f as FolderItem, g as FolderItem) as Boolean If f <> nil and g <> nil then '#if targetMacOS 'Return (f.MacVRefNum = g.MacVRefNum) and (f.NativePath = g.NativePath) and (f.name = g.name) '#endif '#if targetWin32 Return StrComp(f.NativePath = g.NativePath, 0) '#endif Else Return false End if End Function

but I get on error on StrComp of [quote]RecentItemsManager.Equals, line 6. Not enough arguments: missing String value for parameter “a”[/quote]

As far as I can tell everything is correct.
Can someone explain what is going on?

The docs for StrComp say it’s parameters are StrComp(string1, string2, mode)
What you’re passing doesn’t fit, pass the strings separately.

But at that point, wouldn’t if FolderItem1 = FolderItem2 then work?

Thanks Tim. I will use that and don’t need to test.

My confusion is also the error message. Got any idea what the “a” is? I should have 2 strings. I even changed out the equal sign for a comma and it didn’t work?

StrComp returns an integer, not a boolean. To turn it into a boolean, use:

return StrComp ( a, b, 0 ) = 0

Oh. Looking at the wrong piece. The Return and not StrComp.