home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sun4nl!wtrlnd!contrast!postmaster
- From: berend@contrast.wlink.nl (Berend de Boer)
- Newsgroups: comp.lang.pascal
- Subject: tvquestion
- Message-ID: <726229326.AA01017@contrast.wlink.nl>
- Date: Tue, 05 Jan 1993 09:54:42
- Sender: postmaster@contrast.wlink.nl
- Lines: 82
-
- AN> Hi,
- AN> my name Mark Nowinski I was wondering how I can put my
- AN> program into Turbo Vision. (Program listed below)
-
- AN> Program Convert;
- AN> Uses CRT;
- AN> const
- AN> intercept = 32.0;
- AN> slope = 1.8;
- AN> Var
- AN> fahrenheit, celsius : real;
- AN> begin
- AN> ClrScr;
- AN> write('Enter the degrees in Celsius: ');
- AN> readln(celsius);
- AN> fahrenheit := intercept + celsius * slope;
- AN> writeln('That is equal to ',fahrenheit:3:0,' degrees
- AN> F'); repeat until keypressed;
- AN> ClrScr;
- AN> end.
-
- program Demo;
- uses Objects, Views, Dialogs, App;
- const
- intercept = 32.0;
- slope = 1.8;
- var
- MyApp : TApplication;
- Dialog : PDialog;
- R : TRect;
- s : string;
- P : PView;
- fahrenheit, celsius : real;
- code : word;
- Result : word;
- begin
- MyApp.Init;
- R.Assign(20,6, 58,16);
- Dialog := New(PDialog, Init(R, 'Celsius'));
- with Dialog^ do begin
- R.Assign(2,2, 30,3);
- Insert(New(PStaticText, Init(R, 'Enter the degrees in Celsius')));
- R.Assign(2,3, 19,4);
- P := New(PInputLine, Init(R, 15));
- Insert(P);
- R.Assign(14,7, 24,9);
- P := New(PButton, Init(R, 'O~K~', cmOK, bfDefault));
- Insert(P);
- SelectNext(FALSE);
- end; { of with }
- Result := MyApp.ExecView(Dialog);
- Dialog^.GetData(s);
- Val(s, celsius, code);
- fahrenheit := intercept + celsius * slope;
- Val(fahrenheit:3:0, s);
- R.Assign(20,6, 58,16);
- Dialog := New(PDialog, Init(R, 'Fahrenheit'));
- with Dialog^ do begin
- R.Assign(2,2, 30,3);
- Insert(New(PStaticText, Init(R, 'That is equal to ' + s + ' degrees
- F')));
- R.Assign(14,7, 24,9);
- P := New(PButton, Init(R, 'O~K~', cmOK, bfDefault));
- Insert(P);
- end; { of with }
- Result := MyApp.ExecView(Dialog);
- MyApp.Done;
- end.
-
-
- AN> I would appreciate if someone wrote a short demo program.
-
- Maybe this can help you. I do not know if it works, it is entered by
- head but it should give you at least an idea.
-
-
- Groetjes,
-
- Berend. (-:
- fido: 2:281/527.23
- email: berend@contrast.wlink.nl
-
-