I have the following original code:
ws ?= workbook.worksheets.item (as_sys_string("Processed"))
I attempted to translate it as:
if attached workbook as a_wb and then
attached a_wb.worksheets as a_wshs and then
attached a_wshs.item (as_sys_string("Processed")) as a_wshs_item
then
ws := a_wshs_item
end
where the locals are
workbook: detachable EXCEL_WORKBOOK
ws: detachable EXCEL_WORKSHEET
and get the error below.
I did attempt to include the target type, but the syntaxes tried fail (e.g. "... as a_wshs_item: EXCEL_WORKSHEET").
The error is
VJAR: Source of assignment does not conform to target. CONFIGURATION_DIALOG.select_weather_data_file (root_cluster) 103, 6
Error code: VJAR
Type error: source of assignment does not conform to target.
What to do: make sure that type of source (right-hand side)
conforms (in the sense of inheritance rule) to type of target.
Class: CONFIGURATION_DIALOG
Feature: select_weather_data_file
Target name: ws
Target type: detachable EXCEL_WORKSHEET
Source type: attached SYSTEM_OBJECT
Line: 103
attached a_wshs.item (as_sys_string("Processed")) as a_wshs_item then
-> ws := a_wshs_item
end