Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
Sign in to follow this  
Followers 0
-TK-

Naturally, I did <Insert silly thing here>.

1 post in this topic

I am an AS level student at a well known college in the UK. I took computing, the biggest mistake ever, I find it too boring because I practically know 10 times what the course limits the teaching to. I have some coursework, and it was due in for an evaluation by the teacher a few days ago, so naturally I'm doing it for this lesson because I "felt unwell" on the actual date. And since this is a very important piece of coursework, naturally I'm doing it the day/evening before/ on the day in the morning.

I knew I could make a simple version of what they ask us to do in just 30 minutes. We basically have to make a program in turbo pascal that allows for the editing of a database. With some additional stuff like password protection and encrypting. Because I'm insane, at first I decided to try to make a pascal unit that could be used to make a database for anything, everything started off well, and then I got bored. Naturally, I went to play some CSS and procrastinated a bit. The problem with making an infinitely expandable system when you don't need an infinitely expandable system is that a ). you are never going to use it and b ). you can do much better in something like c++. So I've settled on the bare minimum, of course its got silly features like proper encryption and a random object shoved in somewhere where it's not needed, oh and also the distinct lack of any single comment. (I need to add these for every line - postponed indefinitely.)

So now I'm sitting here, procrastinating more by writing this.

Here's the not yet finished code btw:

program database;uses wincrt, crt;type  verificator : object	function scalpha(instring : string):boolean;	function scsolid(instring : string):boolean;  end;var  verify : verificator;  dontclear : boolean;  name, password : string;  passwordset, dbfilemade, loggedin : boolean;procedure read_settings;var  initfile : text;  Spasswordset, Sdbfilemade : string;begin  assign(initfile, 'C:UsersOwnerAppDataRoamingDatabasefilesinit.cfg');  {$I-}  reset(initfile);  {$I+}  if (IOResult <> 0) then writeln('Error: init.cfg not found.');  readln(initfile, Spasswordset);  readln(initfile, Sdbfilemade);  if Spasswordset = 'true' then passwordset := true  else if Spasswordset = 'false' then passwordset := false;  if Sdbfilemade = 'true' then dbfilemade := true  else if Sdbfilemade = 'false' then dbfilemade := false;  close(initfile);end;procedure write_settings;initfile : text;Spasswordset, Sdbfilemade : string;begin  assign(initfile, 'C:UsersOwnerAppDataRoamingDatabasefilesinit.cfg');  rewrite(initfile);  if passwordset = true then Spasswordset := 'true'  else if passwordset = false then Spasswordset := 'false';  if dbfilemade = true then Sdbfilemade := 'true'  else if dbfilemade = false then Sdbfilemade := 'false';  writeln(initfile, Spasswordset);  writeln(initfule, Sdbfilemade);  close(initfile);end;function ctalpha(instring : string);beginend;procedure welcome;begin  dontclear := true;  writeln('Hello, welcome to the SADS booking database management program, please log in.');end;procedure log_in;var  rawpassword : string;begin  if dontclear = false then clrscr;  dontclear := false;  write('Please enter your username: ');  readln(name);  if passwordset = false then  begin	writeln('You have not previously set a password.');	writeln('Please set a password now, it will be used to secure the data stored.');	write('Password: ')	readln(rawpassword);	password := ctalpha(rawpassword);	passwordset := true;	loggedin := true;  end  else if passwordset = true then  begin	write('Enter your password: ');	readln(rawpassword);	password := ctalpha(rawpassword);	passwordset := true;	loggedin := true;  end;end;begin  welcome;  read_settings;  log_in;end.

Yes it sucks atm.

0

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0