I searched and searched for how to invoke something like ToString or Trim on a form object in Visual COBOL and did not find anything. In my testing I found that the "::" works for "dereferencing" in Visual COBOL much the same way that "." works in Visual Basic. To create a string the has a button in it, I can use this statement:
MOVE "Button name = [" & btnMenu::Name::Trim & "]" TO WorkString.
This will result in "Button name = [My Button]"
A numeric property value can be converted to a string using ToString.
MOVE "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" TO WorkString.
However, currently with version 4, while this works for the MOVE statement, this cannot be used inside a STRING statement.
#method#VisualCOBOL#Reference#.net#dereferenceThe above works fine inside a STRING statement as we discussed in Support Incident 3160957. The real issue is when using a string property as the receiving field in the STRING statement.
The following MOVE and STRING statements work fine:
MOVE "Button name = [" & btnMenu::Name::Trim & "]" TO WorkString.
STRING "Button name = [" & btnMenu::Name::Trim & "]" INTO WorkString.
MOVE "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" TO WorkString.
STRING "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" INTO WorkString.
The following MOVE statements work fine even with a Text property as the receiving field:
MOVE "Button name = [" & btnMenu::Name::Trim & "]" TO textBox1::Text.
MOVE "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" TO textBox1::Text.
The following STRING statements fail with COBCH errors due to receiving field as a Text property:
STRING "Button name = [" & btnMenu::Name::Trim & "]" INTO textBox1::Text.
STRING "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" INTO textBox1::Text.
Our development team is looking to this issue.
I searched and searched for how to invoke something like ToString or Trim on a form object in Visual COBOL and did not find anything. In my testing I found that the "::" works for "dereferencing" in Visual COBOL much the same way that "." works in Visual Basic. To create a string the has a button in it, I can use this statement:
MOVE "Button name = [" & btnMenu::Name::Trim & "]" TO WorkString.
This will result in "Button name = [My Button]"
A numeric property value can be converted to a string using ToString.
MOVE "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" TO WorkString.
However, currently with version 4, while this works for the MOVE statement, this cannot be used inside a STRING statement.
#method#VisualCOBOL#Reference#.net#dereferenceAs we discussed in 3160597, the reference does NOT work for me inside the STRING statement! There are no build errors but there also is no string. The contents of the property do not get added to the string. It works fine in the MOVE statement but NOT inside the STRING statement.
True, the build is fine but the compiled code does not work for the property reference INSIDE the STRING statement.
I searched and searched for how to invoke something like ToString or Trim on a form object in Visual COBOL and did not find anything. In my testing I found that the "::" works for "dereferencing" in Visual COBOL much the same way that "." works in Visual Basic. To create a string the has a button in it, I can use this statement:
MOVE "Button name = [" & btnMenu::Name::Trim & "]" TO WorkString.
This will result in "Button name = [My Button]"
A numeric property value can be converted to a string using ToString.
MOVE "Button name = [" & btnMenu::TabIndex::ToString("0#")::Trim & "]" TO WorkString.
However, currently with version 4, while this works for the MOVE statement, this cannot be used inside a STRING statement.
#method#VisualCOBOL#Reference#.net#dereferenceI prefer to use the SET statement in combination with syntax like C#.