1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Delphi.

Discussion in 'Programming' started by Sixx, Sep 7, 2015.

  1. Sixx

    Sixx presidential #1 Legend

    So, as a prerequisite to my very primitive knowledge of Lua, I've decided to start learning Delphi (or stealthy delphi as I like to call it since I hadn't heard of it before today).
    I started this online course thing that basically walks me through how I can write a program that adds up numbers, divides numbers and see how many times X can go into Y, and so on.

    Anyone else heard of this language? Any tips?
     
  2. Daohlocks

    Daohlocks The Bible is my favorite sci-fi novel.

    Coolio.
    Never heard of Delphi, been wasting my time with Java and HTML instead.
    I might check Delphi sometime in the future as Java is sometimes painful for me to operate. Took me three days to notice that * divides.
     
  3. NightAngel

    NightAngel Fuck off Lev

    Never heard of this language, but if you want to improve your knowledge of Lua, I'd recommend improving your knowledge of Lua instead of picking up some other language. What runs on Delphi and how'd ya find it?
     
  4. Sixx

    Sixx presidential #1 Legend

    I want to improve my knowledge of programming in general before I pick up Lua.
    Believe it or not, I was actually searching up Lazarus, as in, the Roleplaying Community, and ended up stumbling on Lazarus the application development.. Um, application. Which was described to look a lot like and work similar to the Delphi Programming tool developed by Embarcadero Studios. I had a gander at it, and decided to download RAD Studio, where I'm now learning all sorts of things. I could write you a program to find the measurements of a swimming pool, if you wanted. :p
     
  5. Zig

    Zig Guest

    you know that'd be sorta useful to me.
    i have a really shitty yard i wanna level out to be flat, but i'm not sure when i wanna do it.
    i'm interested, if you make anything show me :)
     
  6. RJ

    RJ no pay Legend Clockwork Customer

    Choose any place to start that you feel comfortable in. Once you start learning stuff in programming and come back to where you wanted to work in, you may be pleasantly surprised how easy some things can be.

    What kind of fucked up version of Java are you using that divides with *?
     
    • Funny Funny x 1
  7. Daohlocks

    Daohlocks The Bible is my favorite sci-fi novel.

    No idea, but it only worked after I put an * on the designated space.
    It was a long time ago, anyways.
     
  8. Sixx

    Sixx presidential #1 Legend

    Delphi's really funny about that, you can use the standard operator for divide but you can also use MOD and DIV which give you two different answers, if you get me?
    Code:
    var number1, number2:integer
    var divResult:integer
    
    begin
    writeln('Enter a number');
    readln(number1);
    writeln('Enter a second');
    readln(number2);
    divResult:= number1 DIV number2;
    writeln(number1, ' divided by ', number2, ' equals ', divResult);
    readln;
    end.
    Something along those lines, anyways. :p
     
  9. RJ

    RJ no pay Legend Clockwork Customer

    I haven't really taken a look at Delphi but it looks like a sort of pseudo code kind of language (much like COBOL).
     
  10. Daohlocks

    Daohlocks The Bible is my favorite sci-fi novel.

    .....
    i'll fucking dump java and start making more calculators if it's that simple.
     
  11. vexus

    vexus ej rockwell's worst nightmare Staff Member Manager Legend Clockwork Customer

    Dephi is an IDE using Pascal I think. Not really the most common anymore, like, who tf uses Pascal.
     
  12. NightAngel

    NightAngel Fuck off Lev

    • Funny Funny x 1
  13. duck

    duck Phant0m Legend

    I don't recommend Delphi. There just isn't any demand for it, and Lua is easier.
     
    • Agree Agree x 1
  14. vexus

    vexus ej rockwell's worst nightmare Staff Member Manager Legend Clockwork Customer

    HAI 1.2
    CAN HAS STDIO?
    VISIBLE "HAI WORLD!!!1!"
    KTHXBYE

    I'm learning Python rn, I love it.
     
  15. Sixx

    Sixx presidential #1 Legend

    Recently learnt how to write programs that can;
    • Tell a user's birthday.
    • Give a mark out of a grade boundary.
    • Asks a user if they would like to purchase a product, quantity of product required, and the total cost (inc. VAT + Shipping using const values)
    • Convert metric values.
    • Convert currency.
    Code:
    begin
    if (sixx = canCode) then
    writeln('Ha, he's actually learning!');
    readln;
    end.
     
    • Winner Winner x 1
    • Good Coder Good Coder x 1
  16. Sixx

    Sixx presidential #1 Legend

    Update time!
    So far I've learnt how loops and indefinite loops work (repeat until, while do), cases, primitive strings, constants and with these I've wrote programs that can;
    • Prompt a user to enter a number of students and, using loops, ask their name, marks and give an individual grade boundary.
    • Tell a user whether or not a number is a multiple of three, five or seven (and displays all three.)
    • Calculate NET Pay based off of whether or not the user has a gross pay of > £40,000 and the VAT they'll have to pay.
    • Using loops, prompts the user to input a number and displays that number in the 12* table. (1x4 = 4, 2x4 = 8, 3x4 = 12, ect)
    • Ask a user to validate a program by typing an integer above 0, all iterations are added up and the total iteration count is displayed (thus ending the loop) when the user types a rogue value. (Or, 0.)
    • Do the same as above, only in a totally different syntax (using while instead of repeat), and displays an average at the bottom by doing avrg:=sum/count;
    • Display a truncate of a real number as an integer.
    • Display all square numbers between an integer inclusive.
    All of these are simple walls of texts that only equate to console programs, but I'm definitely looking forward to writing actual applications with boxes and shit so you guys can try them out. ^_^
     
  17. RJ

    RJ no pay Legend Clockwork Customer

    Nice progress so far. Just keep sticking with it and as time goes on you'll get better and better. :)
     
    • Friendly Friendly x 1
  18. Sixx

    Sixx presidential #1 Legend

    Recently got onto some newer things with the whole console programming thing.
    • Struggling to comprehend one-dimensional arrays.
    • Randomizing Numbers using Math Clause
    • Advanced DateToStr and TDateTime functions
    • Palindromes (ez pz)
    • ASCII Code
    • With the randomizing numbers knowledge, I've written programs that simulate dice, guessing games, and mixing that in with the OD Arrays; a lottery.
    • Coded a mock-up student database.
    That's all of the exercises for this particular module finished, looking forward (sorta) to 2D Arrays and whatever's next.
     
  19. RJ

    RJ no pay Legend Clockwork Customer

    Arrays are very essential, and it was also awhile before I fully grasped them. Take a look at this picture (but ignore the address part, that's not important for now):

    [​IMG]

    This is a 1 dimensional array called roll. Arrays can be named anything you'd like, but in this case, it's called roll. The Values row can be anything you define as well, but in this example they've already been defined for you.

    If you look at the Name row you'll see it go roll[0], roll[1], roll[2], etc. See how it starts at 0 and goes up by 1 for each column? The numbers inside those square brackets are called indexes. Those are basically the ID's to access the values right below them. For example, the index at 5 holds the number 49, the index at 0 holds 12, the index at 7 holds 11, and I'm sure by these examples you can determine what is stored at each index in the image.

    Note: Most programming languages have their indexes starting at 0, but some other languages start at a different number (e.g. Lua in Gmod starts at 1). Just be sure to google it to make sure (e.g. "starting index number for X programming language").

    There's a lot you can do with arrays, one important concept you'll definitely come across in the future (if you continue with this) is seeing arrays stored inside of arrays. These are called multidimensional arrays and can be even more confusing, but, stick with trying to understand the 1 dimensional array as best as you can now and then when you do come across multidimensional arrays, they'll be a lot easier to understand.
     
    • Like Like x 1
  20. Sixx

    Sixx presidential #1 Legend

    This is really helpful, I'm starting to get a better grip with them. I'll post screenshots of my work on the exercises for arrays when I next get a chance, as far as I'm aware arrays in Delphi are really similar to other languages in how they're declared and stuff.

    Thanks a lot, man.
     

Previous Readers (Total: 0)