We help IT Professionals succeed at work.

Help with functions

LostOne
LostOne asked
on
203 Views
Last Modified: 2010-04-04
I must be missing something simple. I add the the following function to unit1.pas:

function CheckPath(s: String): String;
begin
if (AnsiLastChar(s) = '\') then
CheckPath := Copy(s,1,Length(s) - 1)
Else
CheckPath := s;
end;

when i try to do s := CheckPath(DirectoryListBox1.Directory) in a procedure I get:

[Error] Unit1.pas(49): Undeclared identifier: 'CheckPath'

What am I missing?
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, the function came after the procedure I was trying to use it in. Doesn't make a difference is VB so I didn't even think aobut that.

Thanks.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.