- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Say I have an array of class People called Employees,
ArrayOfEmployedAtAge = Employees(:)%BirthDate - ArrayOfEmployedDate
The result is
error #6159: A component cannot be an array if the encompassing structure is an array.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the BirthDate component a non-allocatable, non-pointer, integer scalar? If so... Employees%BirthDate will be an integer array (the (:) bit is frippery in this context). If not... it will be something else, possibly an error.
As per #2... please show the declarations.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are not clear about:
- The question you want an answer to (I guess it is: how to solve the compile error, but then we need information on what you actually want to do)
- The declaration of the various variables. I guess from the error message that BirthDate, the one component in this statement, is not a scalar, but given the missing declarations, it is no more than a guess
Please provide the missing information, so we can help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Arjen Markus wrote:
You are not clear about:
- The question you want an answer to (I guess it is: how to solve the compile error, but then we need information on what you actually want to do)
- The declaration of the various variables. I guess from the error message that BirthDate, the one component in this statement, is not a scalar, but given the missing declarations, it is no more than a guess
Please provide the missing information, so we can help.
I want to make a integer array from the birth date of employees. But Employees is an array of objects and the birth date is only a property.
Question: Is there a syntax error in this line?
ArrayOfEmployedAtAge = Employees(:)%BirthDate - ArrayOfEmployedDate
Will Employees(:)%BirthDate return an integer array of BirthDates?
If not what is the right way of doing that (without making a loop)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the BirthDate component a non-allocatable, non-pointer, integer scalar? If so... Employees%BirthDate will be an integer array (the (:) bit is frippery in this context). If not... it will be something else, possibly an error.
As per #2... please show the declarations.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page