[comp.lang.pascal] HELP !

commonwealth@cdp.UUCP (07/18/88)

I have a more simplistic question, since most of you seem to be out
of my ball park in terms of level of programming skill.  I learned
Pascal on a mainframe, to which I no longer have access.  I have
turbo pascal for my IBM PC, but I can'
t seem to get the input file to be accessed correctly.  How do I do
it?
--Andy Perrin (commonwealth)

tomk@lakesys.UUCP (Tom Kopp) (07/21/88)

In article <72200001@cdp>, commonwealth@cdp.UUCP writes:
> 
> I have
> turbo pascal for my IBM PC, but I can'
> t seem to get the input file to be accessed correctly.  How do I do
> it?

I had a similar problem....I went from Pascal on an (ack) PR1ME 750 (Which I
despised) Back to using Turbo, and I'd forgotten how to open files...
Instead of simply 
	reset(infile,'mytext.txt');
I re-discovered I had to use
	assign(infile,'mytext.txt');
	reset(infile);

Hope this helps!

jjuanyse@gara.une.oz.au (Mr. XXX) (11/12/90)

If someone knows how to convert a string into an integer
please help me .
thanks in advance 

             ______
   _________/  _   \          Jaime Juan y Seva 
  / --- ---   /_    \         Computer Science
 / _/ . _/ \/ _/.   /         University of new England
 \_______  / ______/          Elm jjuanyse@gara.une.oz.au 
	\___/	
                Smile & be Happy !!
                --------------------			

defaria@hpclapd.HP.COM (Andy DeFaria) (11/13/90)

>/ hpclapd:comp.lang.pascal / jjuanyse@gara.une.oz.au (Mr. XXX) /  4:57 pm  Nov 11, 1990 /
>If someone knows how to convert a string into an integer
>please help me .
>thanks in advance 

You look at the string "123" and say "It's an integer!!!" :-).

Seriously, you  want to convert   a string to an  integer  in what  form of
Pascal?  Assuming you mean: How  can I convert a string  to a integer using
Turbo Pascal?  then I would suggest looking at the "val" procedure.

pschwart@vms.macc.wisc.edu (Paul Schwartz) (11/13/90)

In article <4650@gara.une.oz.au>, jjuanyse@gara.une.oz.au (Mr. XXX) writes...

>If someone knows how to convert a string into an integer
>please help me .

    Loop through the string left to right, each character represented by n, and 
apply the equation: 
    			int := (int * 10) + n

    e.g. 128 => integer
    		int := (0 * 10)  + 1 := 1
    		int := (1 * 10)  + 2 := 12
    		int := (12 * 10) + 8 := 128

    						- Z -

+-----------------------------------------------------------------------------+
|  PauL M SchwartZ              |                                             | 
|  PSCHWART@macc.wisc.edu       |       Your message here...                  |
|  PSCHWART@wiscmacc.BitNet     |                 only 5$ per post            |
|  (608)255-5702                |                                             |
+-----------------------------------------------------------------------------+