home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_01_02
/
1n02064a
< prev
next >
Wrap
Text File
|
1990-07-09
|
2KB
|
53 lines
#LOGiiX
{Dialog Box Query Example}
function main()
begin
result := Answer(3,"Yes, No, Cancel","Do you want to Print this Document?");
If (result = 6) then
begin
DoMenu("Print...");
end
else if (result = 7) then
begin
result2 := Answer(4,"Yes/No","Do you want to Open a File?");
if (result2 = 6) then
begin
DoMenu("Open...");
end
else if (result2 = 7) then
begin
MessageBox(" OK. Bye!");
end;
end;
end
#LOGiiX
{Command to log user name, date, and time to a file}
function main()
begin
{Setup Strings}
String1 := "This function will ask for your name, then\n";
String2 := "create a log file with your name and the\n";
String3 := "date and time you activated the button\n";
String4 := "Do you want to continue?";
ret :="\n";
{Display descriptive dialog box}
result := Answer(4,"Logging Command",String1+String2+String3+String4);
If (result = 6) then {If YES go on}
begin
hText := Open("LOG.GUI",0,0); {Open log file - invisible}
hTop := GetFocus(hText);
name := Ask("Karen Watterson","Enter your name, Please"); {Accept name input}
time := DateTime(); {Set time string}
buffer := " selected the button at "; {Set static text}
SetSelection(hText,hTop,65535,65535); {Set insert point to end of file}
InsertText(hText,name+buffer+time+ret); {Write data to file}
MessageBox(name+buffer+time); {Display what was written}
MessageBox("Look at the file LOG.GUI to see the entries");
Close(hText,1+256); {Close file & save all changes}
end;
end