Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indy and FTP

Status
Not open for further replies.

jfreak53

IS-IT--Management
Apr 30, 2004
44
GT
Does anyone know where I can find a good exmaple or tutorial on Delphi 6 and Indy 8 for FTP? I found one for indy 10 but to be honest the differences I see are too much. Any ideas?

I just want a simple directory lister and navigator, that's it. But between indy 10 and 8 are driving me crazy ha ha.

Thanks in advance.
 
Delphi 6? Indy 10? Do you think you could download the latest version of Indy (version 10), install it, and use it? That way you could take full advantage of the Indy 10 examples.

Just a thought...

Steve.
 
Hmm it would be an option yes, but about 6 months ago I tried that and for some reason it wouldn't install on my Delphi, I mean it installed but I had major major errors. So I just forget it. I would really like to find something for this version if possible. If not I guess I can try that once more.
 
I understand, I have had trouble installing newer versions of Indy myself. I thought it was just me.

Steve.
 
I use D6 and Indy 10, I've never had any issues installing it. Just make sure you follow the install instructions, by loading the appropriate packages, and compiling, then installing them.
 
I believe you also have to completely uninstall and remove the currently installed version of Indy (?).
 
Yeah well I've been there once again this morning and still breaking so I am going to have to make a small hack to make it work the way I want it to.

Ok I found a demo, but I need this now.

How would I make a function that takes a string and finds the last occurence of a "space" for instance in it and then returns from there to the end of that string?? I'm pretty sure I have to use pos and for I := length to 0 or something like that to figure it out. But I just tried it and I got a headache.

So anyone ever done this and have this code already made up?

Thanks for all the ideas guys.
 
How would I make a function that takes a string and finds the last occurence of a "space" for instance in it and then returns from there to the end of that string?? I'm pretty sure I have to use pos and for I := length to 0 or something like that to figure it out.


Ahem, I uh... have some code written for C++ Builder. It does, indeed use .Pos() to find spaces. To the function I wrote one passes usInputString, iWhichColumn, and usSearchString. The function returns the specified string.

For example, imagine a string like the following: "one two three four five". Now imagine the following line of code:
Code:
usResponseString = TextRout->ExtUnicodeStrData("one two three four five", 4, " ");
usResponseString would be "four".

I also have a function that can count the number of occurrences of a string.


I use the code in practically EVERY program I write and it works with strings of practically any size for both the input string and the search string.


If you are interested, I can post the code. My object PASCAL is pretty weak so one would have to re-interpret the code, but I think that would be pretty easy.


Steve.
 
Code:
[navy][i]// for automatic syntax highlighting see faq102-6487 
[/i][/navy][b]function[/b] GetFromLastChar(AStr: String; AChar: Char): String;
[b]var[/b]
  c : Integer;
[b]begin[/b]
  Result := [teal]''[/teal];  [navy][i]// what to return if AChar not found
[/i][/navy]  [b]for[/b] c := Length(AStr) [b]downto[/b] [purple]1[/purple] [b]do[/b]
    [b]if[/b] AStr[c] = AChar [b]then[/b]
    [b]begin[/b]
      Result := Copy(AStr, c + [purple]1[/purple], Length(AStr) - c);
      Break;
    [b]end[/b];
[b]end[/b];

[b]begin[/b]
  Edit2.Text := GetFromLastChar(Edit1.Text, [teal]' '[/teal]);
[b]end[/b];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top