Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: String handling issue with Free Pascal

  1. #11
    If you would want to optimize it a bit, i would first get rid of NextChar() function. You could put all valid characters in a string constant, something like
    Code:
    const validstr = 'abcd....ABCD....XYZ0123456789';
    Then matter of changing character is simply increasing character index by 1.

    Code:
    index:=1;
    validstr[index] is 'a'
    inc(index);
    validstr[index] is now 'b'

  2. #12
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,246
    Blog Entries
    2
    Quote Originally Posted by Sogcelak View Post
    I actually needed to look up how multithreading exactly works in Pascal. And I still don't get half of it, so that will take some time. Keep in mind I've hardly ever used objects in my programs, only simple ones. This TThread class is a mess compaired to them.

    I've deleted the part of the program where it writes out every try, now it just outputs the result, and it is a lot faster now. At 5 character length it still seems unexplainably slow(I haven't tried with more). This multithreading seems like something that could work but I need to study it further before I can implement it in my program.
    I have a tutorial that covers the basics of multi-threading.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  3. #13
    @User137
    That will be implemented in the program, but first I need to optimize other things. If I want to add capitalized characters into the pool of characters my program uses, then it adds another 23 characters and it will make things a hell lot slower even without the NextChar function.

    @Athena
    That's a really cool guide you have written but erm... The basics, you say?? Unfortunately for me I could understand it until the second page, and there were things I didn't understand on the first page too(VCL thread??, TDXTimer??). It's just too advanced stuff for me. I don't know most of these functions. I don't know how classes handle these public and protected stuffs, or what's that constructor thing, how does inheriting work, what the hell does "try", "except", and "finally" do etc...etc... Hell, I don't even know how the OS exactly handles multithreading. How am I supposed to tell it how to do it, if I don't even know how it should be working? And finally, I also have no idea about how exactly can I use multithreading to fasten up this program. My program does one thing, and it is trying all different combinations of characters, so I don't see what tasks I could give to another thread. See I'm having difficulties with understanding the most basic things about multithreading, that's why I said I needed to study it a bit before I can implement it in my program.

  4. #14
    Quote Originally Posted by Sogcelak View Post
    @User137
    That will be implemented in the program, but first I need to optimize other things. If I want to add capitalized characters into the pool of characters my program uses, then it adds another 23 characters and it will make things a hell lot slower even without the NextChar function.

    @Athena
    That's a really cool guide you have written but erm... The basics, you say?? Unfortunately for me I could understand it until the second page, and there were things I didn't understand on the first page too(VCL thread??, TDXTimer??). It's just too advanced stuff for me. I don't know most of these functions. I don't know how classes handle these public and protected stuffs, or what's that constructor thing, how does inheriting work, what the hell does "try", "except", and "finally" do etc...etc... Hell, I don't even know how the OS exactly handles multithreading. How am I supposed to tell it how to do it, if I don't even know how it should be working? And finally, I also have no idea about how exactly can I use multithreading to fasten up this program. My program does one thing, and it is trying all different combinations of characters, so I don't see what tasks I could give to another thread. See I'm having difficulties with understanding the most basic things about multithreading, that's why I said I needed to study it a bit before I can implement it in my program.
    I think you need to have a look here. It's a Delphi "starters" site, were most of the language is explained. It is not very updated to last Delphi version, but the basics are there.

  5. #15
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,246
    Blog Entries
    2
    Quote Originally Posted by pitfiend View Post
    I think you need to have a look here. It's a Delphi "starters" site, were most of the language is explained. It is not very updated to last Delphi version, but the basics are there.
    I would also add http://www.pp4s.co.uk/main/tutorials.html. A good friend of mine has been using the PP4S tutorials to teach herself Delphi and she's found them pretty good although they do have a preference for Free Pascal.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  6. #16
    Thanks for the links guys. I will look at them. Especially the Free Pascal one, since that's what I'm using.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •