× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Tue, 29 Jul 2003, Booth Martin wrote:
>
> But the real question that I don't understand is... What good is a D type
> field if you can put anything that you want to into it?
>

All variables, no matter what they are, are stored in RAM.  (well,
technically "main storage" but let's just think of it as RAM for now)

Since RAM is used for everything, it can store any potential bit values.
Thus, you can place things like "Santa Claus" into RAM.  This should not
be a surprise.

If a date field is stored in an area of RAM that contains the value "Santa
Claus", what do you expect the system to do?


You can't do this -- it would give an error:

c                   eval      DateField = 'SantaClaus'

but you can do this:

c                   eval      pointer_to_alpha_field = address1
c                   eval      pointer_to_date_field = address1
c                   eval      alpha_field = 'SantaClaus'

now the date field (since it's pointing to the same memory as the alpha
field) contains the words SantaClaus.   There's not much the system can
do, since they're in the same memory.

Another way to accomplish the same thing is:

D                 DS
D   date_field            1     10D
D   alpha_field           1     10A

c                   eval      alpha_field = 'SantaClaus'

In either case, the date_field and alpha_field occupy the same space in
RAM.

There's nothing the system can do to stop you from assigning any
value to that RAM.  How could it?

The real question is, why would a programmer write code like this?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.