comp.lang.ada
 help / color / mirror / Atom feed
* Using records properly.
@ 2001-03-14 21:09 McDoobie
  2001-03-14 22:28 ` Ted Dennison
  0 siblings, 1 reply; 3+ messages in thread
From: McDoobie @ 2001-03-14 21:09 UTC (permalink / raw)


So I have this record in my spec file that goes like this ...

type people_entries is record
        person_name : String( 1..80 );
        person_addr  : String( 1..80 );
        person_num  : String(  1..80 );
        person_mail  :  String( 1..80 );
end record;


Now, I know how to store the information in the record...


NewRec : people_entries;

NewRec := person_name(aName); 

etc....

Now, would I use a "NewRec" for each field, or would I go something like...

NewRec := (aName, aAddr, aNum, aMail);

I'm a little fuzzy on this. 
And how would I tag each record to make it unique, cause all the computer 
is gonna see is "NewRec" and overwrite the last record for each new one 
that is entered.

Thanks.

McDoobie


-- 
This is my sig.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using records properly.
  2001-03-14 21:09 Using records properly McDoobie
@ 2001-03-14 22:28 ` Ted Dennison
  2001-03-14 23:16   ` McDoobie
  0 siblings, 1 reply; 3+ messages in thread
From: Ted Dennison @ 2001-03-14 22:28 UTC (permalink / raw)


In article <86Rr6.57913$W05.11839272@news1.rdc1.mi.home.com>, McDoobie says...
>type people_entries is record
>        person_name : String( 1..80 );
>        person_addr  : String( 1..80 );
>        person_num  : String(  1..80 );
>        person_mail  :  String( 1..80 );
>end record;
>
>
>Now, I know how to store the information in the record...
>
>
>NewRec : people_entries;
>
>NewRec := person_name(aName); 

The syntax would be something a bit more like 
NewRec.Person_Name := aName;
(assuming aName is an 80 character string)

>NewRec := (aName, aAddr, aNum, aMail);
That'll work too (again, assuming all of your a* stuff are 80 character
strings).

>I'm a little fuzzy on this. 
You should really try to get hold of a decent Ada book. This is pretty basic
stuff, and I doubt you want to try to learn *all* the basics one question at a
time in newsgroups. (right?)


---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using records properly.
  2001-03-14 22:28 ` Ted Dennison
@ 2001-03-14 23:16   ` McDoobie
  0 siblings, 0 replies; 3+ messages in thread
From: McDoobie @ 2001-03-14 23:16 UTC (permalink / raw)


Ted Dennison wrote:

> In article <86Rr6.57913$W05.11839272@news1.rdc1.mi.home.com>, McDoobie
> says...
> >type people_entries is record
> >        person_name : String( 1..80 );
> >        person_addr  : String( 1..80 );
> >        person_num  : String(  1..80 );
> >        person_mail  :  String( 1..80 );
> >end record;
> >
> >
> >Now, I know how to store the information in the record...
> >
> >
> >NewRec : people_entries;
> >
> >NewRec := person_name(aName);
> 
> The syntax would be something a bit more like
> NewRec.Person_Name := aName;
> (assuming aName is an 80 character string)
> 
> >NewRec := (aName, aAddr, aNum, aMail);
> That'll work too (again, assuming all of your a* stuff are 80 character
> strings).
> 
> >I'm a little fuzzy on this.
> You should really try to get hold of a decent Ada book. This is pretty
> basic stuff, and I doubt you want to try to learn *all* the basics one
> question at a time in newsgroups. (right?)
> 
> 
> ---
> T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
>           home email - mailto:dennison@telepath.com


Your right. Heh.

I've pretty much been using the online tutorials and documentation to pick 
up this stuff.

Looks like I'm off to Barnes and Noble. There have been some good book 
recommendations here. I'll look them up.

McDoobie


-- 
This is my sig.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-14 23:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-14 21:09 Using records properly McDoobie
2001-03-14 22:28 ` Ted Dennison
2001-03-14 23:16   ` McDoobie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox