#SuperBase Pro 4 Question
5 messages in this thread
In SuperBase, there is a provision for multiple entries in a given field
through a change in the "Responses" function in the field definition. I have
used this successfully to enter data.
However, I have scoured my manuals to find some way to access/ retrieve/use the
multiple response field entries through a query. So far, I have been able to
retrieve only the first entry in the field.
Does anyone have suggestions as to how I can retrieve or sort all the responses
in a query with multiple response fields?
Thank you!
===Ken
Ken,
the value of the multiple repsonse field can be treated as an array. You have
to specifically address the element you want. If you have defined the field:
MyField.MYFILE then you would access element 3 as MyField(2) (arrays start at 0
remember).
Ciao, Neil
Thanks, Neil. But what would I do if, say, I wanted to look at the field that
has multiple entries as a whole? From what you suggested, it seems that each
response is treated like a separate field. Can't I look at all the entries and
search for one attribute?
For instance, if a multiple response field was for categories for a movie, I
would like to be able to enter both "Comedy" and "Social Commentary" as
separate entries in that field, and be able to sort so that the movie would
appear under both the "Comedy" and "Social Commentary" listing.
If it is an array, I should somehow be able to look at all elements at once and
pull that information as needed (for instance, if any(category =Comedy then
[D=Comedy then yes else no) or something like that. But that would be more in
the programming language, rather than in a simple query, right?
Thanks===
===Ken
Ken,
I think this is just a matter of HOW you look at what you are trying to
do. There is nothing wrong with making these single entries (LOGICALs)
and doing a QUERRY for Comedy Field Set true and SocialCommentary Field
Set true, etc. Whether these are stored in an array or as an index field
of one bit, it really doesn't matter. It is just how you are manipulating
the indicies which will position you quickly to the next data element.
One might argue that an array would allow you to continue to store more
information without adding a new field, but with only 10 elements in the
array, expansion is sort of a moot.
You could create a new file which contains the elements you would like to
slect from (comedy, drama, social, western, action, etc.) and include in
each data element the text and a value like 1 for comedy, 2 for drama, 4
for social, 8, 16, 32, 64, etc.). Present a requestor in your form which
allows entry of a text value which is then examined for its numeric value
and this is added to (actually or'd) the previous value for this field.
Then examine any field for the sum of the attributes you are looking for.
Again this is just another way to look at the problem without the use of
arrays.
Clark -|-
Williams –O-o-O– Via George
Ken,
what you are talking about is traditionally handled by building a separate file
for the many portion of your 1 to many relationship. Putting these
characteristics into the same record is not relational and will not work with
the relational query tools.
Ciao, Neil