Concatenating plurals

(imported topic written by brolly3391)

It seems that the concatenation operator (&) does not let you concatenate lists. While playing with the Drive letter/removable media question I stumbled across this limitation. I have hit this snag in the past and had given up. I do see the difficulty. How do you correlate the 2 lists to insure that the first list entries matched the second list entries. In the example, if drive A has no floppy in it then the entry in the File System Type list will be missing and the lists are different lengths and they will match up incorrectly.

q: names of drives

A: A:

A: C:

A: D:

q: file system types of drives

A: NTFS

A: CDFS

q: names of drives & file system types of drives

E: A singular expression is required.

Something more like this? or maybe creative use of a whose it?

q: (names & file system types) of drives

E: The operator “names” is not defined.

q: drives whose (name of it & file system type of it)

E: A boolean expression is required.

q: (name of it & file system type of it) of drives

E: Singular expression refers to nonexistent object.

I am stumped on this one. Maybe one of the higher thinkers can come up with an elegant solution?

Brolly

(imported comment written by dgibson91)

Try this:

q: (names of it, file system types of it) of drives

A: C:, NTFS

A: D:, NTFS

A: F:, CDFS

I: plural ( string, string )

(imported comment written by brolly3391)

dgibson,

I did not know about the comma operator. That was the answer that I was looking for and delivered with speed. Thanks.

When I apply the comma operator as you suggested, the results I get back are not exactly what I expected when operating on plural strings.

q: names of drives

A: A:

A: C:

A: D:

q: (names of it , file system types of it) of drives

A: C:, NTFS

A: D:, CDFS

I would have expected to see:

A: A:,

A: C:, NTFS

A: D:, CDFS

If one of the operands of the comma is non-existant, it seems to drop the entire result.

The comma operator seems to be missing from the Operators table in the String section of WinInspectors-2006-04-28.pdf. I checked for more with

q: binary operators “,”

which returns no answer. I do not know where to look for some documentation on the comma operator.

(imported comment written by BenKus)

Hey Brolly,

The “,” operator allows you to create “tuples” and is only available in BES 6.0 components. For instance:

q: 1,“hi”,now

A: 1, hi, ( Wed, 16 Aug 2006 10:39:07 -0700 )

T: 11.533 ms

I: singular ( integer, string, time )

To answer your original question, you can take advantage of the “it” operator to iterate through a list and withdraw specific attributes. For instance:

q: (name of it & " – " & file system type of it) of drives

A: C: – NTFS

A: D: – CDFS

A: K: – NTFS

A: O: – NTFS

T: 7.091 ms

I: plural string

You basically listed this relevance query in your post, but it is giving an error because there is no file-system type of the “A:”. Try this slight modification:

q: (name of it & " – " & (if (exists file system type of it) then (file system type of it) else “n/a”) of drives

Note that whenever you are iterating through drives, you must be careful because sometimes you will trigger the floppy drive light to access.

Ben