Article View: alt.flame.pascal
Article #36Re: Check this OUT!!!!!! Look over here!!!!
From: Baljit Purewal
Date: Fri, 22 May 1998 00:00
Date: Fri, 22 May 1998 00:00
81 lines
2904 bytes
2904 bytes
Hi I am lost completly please help me figure out this prolbem.I can't seem
to find a way to add words into an array. This is my assignment down below.
CONST
table = 50;
max_wordlength = 25;
lines_per_page = 20;
TYPE
Word_string = string[max_wordlength];
Word_array = array [ 1..tablesize] 0f Integer;
Count_array = array [1..tablesize] of Integer;
VAR
Word : Word_array;
Counts : Count_array;
Infile, Outfile: text;
Function Palindromic (Word : Word_string): Boolean;
{returns Ture if a word id a palindrome
ie if the word read the same forwards and backwards}
Begin
{code}
End;
Procedure Add_Word(new_word: word_string;
Var Words: word_array;
Var counts : count_array);
{add a new word to the array of words, incrementing the
corresponding entry in the array of counts or increment the count of an
existing word}
Begin
{code}
End;
Procedure Read_file (VAR Infile : text;
VAR Words: word_array;
VAR Counts: count_array);
{read words from the input file, adding them to the word and count arrays}
VAR char_buffer : char;
current_word : word_string;
Begin
Assign (infile,'name1');
reset(infile);
current-word :='';
While not eof (infile) do
Begin
Read(infile,char_buffer);
Case char_buffer of
'A'..'Z','a'..'z' : current_word := current_word + char_buffer;
Else
If current_word_word <> '' then {word is non � blank}
Add_word (current_word, Words,Counts);
Current_word:= '';
End;
End; {case}
End;
If current_word <>'' then
Add_word(current_word, words,counts);
End;
Begin {main}
{code}
End. {main program}
I really need help in procedure add_word (current_word, words, counts);
I can't figure it out. please email me at bal01@hotmail.com
Technical Details
Message-ID:
<01bd857b$cb359540$160067d1@baljit>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<895592972.438063@nn1>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111659,546998be133e9d46 X-Google-Attributes: gid111659,public X-Google-Thread: 10eb32,546998be133e9d46 X-Google-Attributes: gid10eb32,public X-Google-Thread: 10261c,546998be133e9d46 X-Google-Attributes: gid10261c,public X-Google-Thread: 10cc59,546998be133e9d46 X-Google-Attributes: gid10cc59,public X-Google-Thread: 108ebd,546998be133e9d46 X-Google-Attributes: gid108ebd,public From: "Baljit Purewal" <bspurewal@sprint.ca> Subject: Re: Check this OUT!!!!!! Look over here!!!! Date: 1998/05/22 Message-ID: <01bd857b$cb359540$160067d1@baljit> X-Deja-AN: 355543460 References: <895592972.438063@nn1> Cache-Post-Path: michelob!unknown@spc-isp-van-uas-01-21.sprint.ca Organization: Sprint Canada Inc. Newsgroups: alt.flame.pascal,borland.public.turbopascal,comp.lang.pascal,comp.lang.pascal.borland,comp.lang.pascal.misc