Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~6K People Reached
Favorite Forums
Favorite Tags

24 Posted Topics

Member Avatar for l_23

See comments in code: [CODE]program pro4(input, output); var tot, num, i: integer; ave: real; begin ave := tot / 4; { tot hasn't been initialized yet. Can't do this here. } for i := 1 to 4 do begin writeln(output, 'Enter integer'); readln(input, num + tot); { You can't perform …

Member Avatar for LizR
0
343
Member Avatar for edabura75

Very basic but should get you started... [CODE]program game; uses SysUtils; var UserInput: string; Number: Double; begin UserInput := ''; Write('Enter a word, character, or number: '); Readln(UserInput); if TryStrToFloat(UserInput, Number) then begin WriteLn('User entered a number.'); end else if Length(UserInput) = 1 then begin WriteLn('User entered a character.'); end …

Member Avatar for trsek
0
201
Member Avatar for phelaphant

[CODE]program keepGoing; uses SysUtils; var Response: string; begin Response := 'Y'; repeat // Do your stuff here. write('Do you want to continue? '); readln(Response); until UpperCase(Response) = 'N'; end.[/CODE]

Member Avatar for Duoas
0
210
Member Avatar for ooglez

[url]http://www.merlyn.demon.co.uk/pas-time.htm#RDT[/url] [url]http://www.geocities.com/prenaud167/Time.htm[/url]

Member Avatar for hani odwan
0
150
Member Avatar for Zababa

[CODE]program Timer; {$mode objfpc}{$H+} uses Classes, DateUtils, SysUtils { add your units here }; var TargetTime: TDateTime; begin; TargetTime := IncSecond(Now, 6); repeat until CompareTime(Now, TargetTime) >= 0; WriteLn('Six seconds have elapsed!'); end.[/CODE]

Member Avatar for Zababa
0
384
Member Avatar for brian1966

Pass the variable "option" as a parameter to the ReadLn function. ReadLn(option);

Member Avatar for Jackrabbit
0
147
Member Avatar for Zababa
Member Avatar for ucdmrt

[CODE]program movies; {$mode objfpc}{$H+} uses Classes, SysUtils; type TMovie = record Name: string; RunTime: Integer; Year: Integer; end; TMovies = array[0..4] of TMovie; var I: Integer; MyMovies: TMovies; begin // Initialize the database MyMovies[0].Name := 'Rocky'; MyMovies[0].RunTime := 119; MyMovies[0].Year := 1976; MyMovies[1].Name := 'Titanic'; MyMovies[1].RunTime := 194; MyMovies[1].Year := …

Member Avatar for Jackrabbit
0
119
Member Avatar for AhmedHan
Member Avatar for beginprog

Hope this helps... [CODE]program a2; {$APPTYPE CONSOLE} uses SysUtils; const population = 10; type TpopRec = record age: integer; agerange: string end; Tperson = array[1..population] of TpopRec; {PRE: true POST: initialise the ages of all population} procedure initialise_age(var ftn: Tperson); var i: integer; begin for i := Low(ftn) to High(ftn) …

Member Avatar for Daaave
0
202
Member Avatar for techied

[QUOTE=techied]How do you use sound and graphics in pascal?[/QUOTE] uses CRT, Graph, Video, etc. [url]http://www.freepascal.org/docs-html/rtl/index.html[/url]

Member Avatar for AhmedHan
0
152
Member Avatar for mpx10

[QUOTE=mpx10]im still struggling to print an invoice that i have made in pascal to a usb port printer. any help please. i have tried using various inbuilt function but have had no luck probably because im coding it wrong. thanks in advance[/QUOTE] This works in Delphi 7 / WinXP: [CODE]program …

Member Avatar for Jackrabbit
0
388
Member Avatar for shmee

[QUOTE=shmee]ok i think the program should look like this.. program pin; uses crt; var; pin : real; begin writeln ('enter pin here'); read (pin); for pin:= 1 to 9 do write ('*'); writeln (' Your pin is',pin); end. when i try to wok it doesn;t do what i want it …

Member Avatar for Jackrabbit
0
169
Member Avatar for Me_Myself

[CODE]program toy; var Option : Integer; procedure ShowMenu; begin writeln; writeln( '+------------------+' ); writeln( '| MENU |' ); writeln( '+------------------+' ); writeln( '| Options: |' ); writeln( '| 0=sleeps |' ); writeln( '| 1=laughs |' ); writeln( '| 2=cries |' ); writeln( '| 3=sings |' ); writeln( '| 4=exit |' …

Member Avatar for kc0arf
0
130
Member Avatar for Paramaribo

[CODE]highestavegrade := 0; for i:=1 to 10 do begin if avegradestudent[i] > highestavegrade then begin highestavegrade := avegradestudent[i]; end; end; for i:=1 to 10 do begin if avegradestudent[i] = highestavegrade then begin { writeln (*GOLD*, etc, etc } end; end; [/CODE]

Member Avatar for Jackrabbit
0
131
Member Avatar for lodacy

[QUOTE=lodacy]I will appreciate any help on the following. Please reply to [email]lotbook@telus.net[/email] as well. I am trying to program something that use huge integer matrices, say 100x1500. I can do it in Unix pascal, but the Unix machines are slow. I also have borland pascal 7.0, but all I could …

Member Avatar for geoclock
0
195
Member Avatar for bwork

You can use the [B]Copy [/B]function like this. [CODE]program TruncateString; {$APPTYPE CONSOLE} uses SysUtils; var Input : String; Output : String; begin writeln; write( 'Enter a string more than three characters long: ' ); readln( Input ); Output := Copy( Input, 1, 3 ); writeln; writeln( Output ); writeln; end.[/CODE] …

Member Avatar for Jackrabbit
0
112
Member Avatar for tux792

Hi Jim, You should always use the "Dim VarName As Type" format in VBA. If you don't declare a type, the variables will default to the Variant type (which can hold any type of data but is not very efficient. Also, according to one book that I have (Excel 2000 …

Member Avatar for tux792
0
440
Member Avatar for nikkisboricua

[CODE]program pizza; {$APPTYPE CONSOLE} uses SysUtils; const CaloriesPerSlice = 355; CaloriesBurnedPerHour = 240; var CaloriesBurnedPerMinute : Double; Hours : Double; SlicesOfPizzaEaten : Integer; TotalCalories : Integer; TotalMinutesToJog : Double; begin writeln; write( 'How many slices of pizza? ' ); read( SlicesOfPizzaEaten ); CaloriesBurnedPerMinute := CaloriesBurnedPerHour / 60.0; TotalCalories := SlicesOfPizzaEaten …

Member Avatar for Jackrabbit
0
156
Member Avatar for dirtyk

[CODE]program dec2hex; {$APPTYPE CONSOLE} uses SysUtils; const BASE16 = 16; var HexValue : string; Remainder : Integer; Quotient : Integer; begin HexValue := ''; write( 'Enter an integer value: ' ); readln( Quotient ); while Quotient > 0 do begin Remainder := Quotient mod BASE16; case Remainder of 10: HexValue …

Member Avatar for Jackrabbit
0
779
Member Avatar for ahmedsamir

Not exactly the formatting you wanted but should get you started... [CODE]program mtable; {$APPTYPE CONSOLE} uses SysUtils; var I : Integer; J : Integer; begin for I := 1 to 12 do begin for J := 1 to 12 do begin write( IntToStr( J * I ) + chr( 9 …

Member Avatar for Jackrabbit
0
337
Member Avatar for Holland

[URL=http://www.freepascal.org/docs-html/fpchelp.html]Free Pascal Online Help[/URL] [URL=http://www.freepascal.org/docs-html/rtl/system/stringfunctions.html]String Handling Function (System Unit)[/URL] Have a look at the Pos function...

Member Avatar for Jackrabbit
0
102
Member Avatar for red_evolve

[code] program FactorialCalculator; {$APPTYPE CONSOLE} uses SysUtils; var input : string; value : Integer; function calculate( num : integer ) : integer; begin if ( ( num = 0 ) or ( num = 1 ) ) then calculate := 1 else calculate := calculate( num - 1 ) * …

Member Avatar for jwenting
0
227
Member Avatar for Holland

1. Is there a length function in Dev Pascal ? If so, what is it? If not, is there a way to achieve the length of a string? Dev Pascal uses either the Free Pascal compiler or the GNU Pascal compiler. [COLOR=Blue]Online documentation for FPC System unit: [I]length[/I]: Length returns …

Member Avatar for Jackrabbit
0
187

The End.