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?
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.