Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-02-2002, 03:33 PM   #1
ldinternet
Confirmed User
 
Join Date: Apr 2001
Posts: 8,245
Does anyone here program in Pascal?

Its shitty, I know.

After creating a file (lets say, c:\notes.txt) or overwriting an existing file, writing to file, reading from file and storing in memory, deleting the contents of the file, and writing to screen from memory, is there any way to delete that file from disk?

I've been looking for a sample code for this but I can't find it anywhere... any help would be appreciated.

Last edited by ldinternet; 03-02-2002 at 03:37 PM..
ldinternet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2002, 03:37 PM   #2
Nysus
Confirmed User
 
Industry Role:
Join Date: Aug 2001
Posts: 7,817
Pascal? I learned that.. when I was .... uhm... 13? ... hehe..

Cheers
Nysus is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2002, 03:39 PM   #3
Pipecrew
Master of Gfy.com
 
Pipecrew's Avatar
 
Industry Role:
Join Date: Feb 2002
Posts: 14,887
Pascal is so old Jesus CoWrote the manual
Pipecrew is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2002, 03:39 PM   #4
ldinternet
Confirmed User
 
Join Date: Apr 2001
Posts: 8,245
Yeah, most of it is easy. Afterall, its an educational language.

We're touching on it as a part of the file concepts unit.

Just can't get my head around how to delete a file from disk. I don't think its possible. Did somebody say "malicious user"? ;)

Last edited by ldinternet; 03-02-2002 at 03:41 PM..
ldinternet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2002, 03:53 PM   #5
-=HUNGRYMAN=-
Confirmed User
 
Join Date: Jun 2001
Location: Between your mamma's legs
Posts: 4,753
not since grade 11 computer sciences ... hehehe

we learnt it on those british "ICON" computers ... weren't all that bad of a machine for the time really ... better than PETs

__________________
-=HUNGRYMAN=- is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2002, 05:15 PM   #6
waste
Confirmed User
 
Join Date: Nov 2001
Location: Baltimore
Posts: 770
man your talking ancent shit now, i have done Pascal work since dial-up BBS's
were still big
waste is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2002, 05:20 PM   #7
ldinternet
Confirmed User
 
Join Date: Apr 2001
Posts: 8,245
You should remember at least a little. ;)

Done all the simple shit, so heres what I got so far... options 1 through 4 aren't working yet ;)

program cinema_pas;

uses wincrt;

var
continue:string;
clear:integer;
menuoption:char;
notation:string;
notefile:text;
username:string[10];
password:array[1..10] of char;
login:array[1..20] of string;
pass:array[1..20] of string;
protect:char;
user:string;
pw:string;
i:integer; {for controlling variable}
num:integer; {another controlling variable}
x:integer;
y:integer; {x and y coordinates}
halter:integer;


begin

clear:=clear+1;

if clear=1 then begin
assign(notefile,'c:\notes.txt');
rewrite(notefile);
close(notefile);
end;


{ PART ONE BEGIN }

clrscr;

gotoxy(5,2);
write('Welcome to the Cinema Ticket System');

gotoxy(5,4);
write('You will be asked for a username and password');
gotoxy(5,5);
write('Press any key to continue');
gotoxy(30,5);
readkey;

{PART ONE END }

login[1]:='staffone';
login[2]:='stafftwo';
protect:='*';

repeat
pw:=('');

repeat

halter:=halter+1;

clrscr;
gotoxy(5,2);
write('Please enter your password then press ENTER');
gotoxy(5,4);
write('Username: ');
readln(username);
gotoxy(5,5);
write('Password: ');

if halter=5 then
begin
gotoxy(5,5);
writeln('Too many incorrect attempts... program closing');
halt;
end;

until (username=login[1]) or (username=login[2]);
y:=15;
num:=5;

for i:=1 to num do
begin
password[i]:=readkey;
gotoxy(y,5);
write (protect);
y:=y+1;
end;

i:=1;

for i:=1 to num do
begin
pw:=pw+password[i];
end;
pass[1]:='somet'; pass[2]:='tsome';;

until
(username=login[1]) and (pw=pass[1]) or
(username=login[2]) and (pw=pass[2]);

begin
readkey;
gotoxy(5,7);
write('You are now logged in');
gotoxy(5,8);
write('Press any ENTER to continue');
readln;
end;

repeat

{PART TWO BEGIN}

clrscr;

gotoxy(5,2);
write('Main menu screen');

gotoxy(5,3);
write('Logged in as user: ',user);

gotoxy(5,5);
write('Customer related');
gotoxy(5,6);
write('1. Reserve a seat');
gotoxy(5,7);
write('2. Cancel a reservation');
gotoxy(5,8);
write('3. Display current seating plan');
gotoxy(5,9);
write('4. Write seating plan to file');

gotoxy(5,11);
write('Non customer related');
gotoxy(5,12);
write('A. Make notation');
gotoxy(5,13);
write('B. Retreive notation');

{PART TWO END}

gotoxy(5,15);
write('Please select an option (1-4 or A-B): ');
readln(menuoption);

if (menuoption='A') or (menuoption='a') then begin
clrscr;

gotoxy(5,2);
write('You chose: Non customer related');
gotoxy(5,3);
write('Option: A, Make notation');

gotoxy(5,5);
writeln('Make notes below, press ENTER to save to file:');
gotoxy(5,7);
assign(notefile,'c:\notes.txt');
rewrite(notefile);
read(notation);

writeln(notefile,notation);
close(notefile);

clrscr;

gotoxy(5,2);
write('Input has been saved.');
gotoxy(5,4);
write('You will be returned to the main menu');
gotoxy(5,5);
write('Press any key to continue');
readkey;

end;

if (menuoption='B') or (menuoption='b') then begin
clrscr;

assign(notefile,'c:\notes.txt');
reset(notefile);
readln(notefile,notation);
write(notation);
close(notefile);

if notation='' then
begin
gotoxy(5,2);
write('The note file is empty');
end;

gotoxy(5,4);
write('Press any key to continue');
readkey;
end;

begin

clrscr;

gotoxy(5,2);
write('Return to main menu or exit the program?');
gotoxy(5,3);
write('Press any key to continue or type EXIT');
gotoxy(5,4);
write('(case sensitive) to exit the program');
gotoxy(8,6);
write('WARNING: All data will be lost on exit!');
gotoxy(5,8);
readln(continue);

end;

until continue='EXIT';

end.
ldinternet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-03-2002, 12:07 AM   #8
-=HUNGRYMAN=-
Confirmed User
 
Join Date: Jun 2001
Location: Between your mamma's legs
Posts: 4,753
I'm drunk ... and now my brain hurts

(sorry Rollin ... I fell off the wagon)
__________________
-=HUNGRYMAN=- is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.