Highlighted
Absent Member.
Absent Member.
1167 views

incompatible types

Jump to solution

I got an incompatible error in my method

error COBCH0968 : Collection element has incompatible type

In that  peace of  code "perform varying val through _where_", the compiler say the type Dictionary[type String type String] is incompatible with KeyValuePair[type String type String] to make the perform ( basicly the is the foreach command )....

method-id Update final public.
working-storage section.
01 vals string.
01 val type KeyValuePair[type String type String].
procedure division using by value tableName as string _data_ as type Dictionary[type String type String] _where_ as string returning rtCode as type Boolean.
declare strB = new StringBuilder("").
move true to rtCode.

if(_data_::Count > 1)
perform varying val through _where_
invoke strB::Append(string::Format(" {0} = '{1}',", val::Key::ToString(), val::Value::ToString()))
end-perform
end-if.
end method.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: incompatible types

Jump to solution

Hello Bencz, in the code sample, it looks as though the variable _where_ is of type string.  Did you mean to use the variable _data_?

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: incompatible types

Jump to solution

Hello Bencz, in the code sample, it looks as though the variable _where_ is of type string.  Did you mean to use the variable _data_?

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: incompatible types

Jump to solution

Ohhhhh, s*** 😞

haha, I had not noticed 😞

Hha, thanks 🙂

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.