PSA: Don't use the word PageBreak as a struct member
[Code]
Use UI
Struct ReportOptions
Boolean PageBreak
End_Struct
ReportOptions options
Move True to options.PageBreak // Compiler Error!
[/Code]
In case you are working with third party WSDL and/or Json and you have to create a corresponding struct (which is kinda out of your control) to receive the data, rest assured that you are not crazy when you see compiler errors that make no sense.
Frank Cheng
Re: PSA: Don't use the word PageBreak as a struct member
Hi Frank,
Have seen the error many times. I think this case is true for almost any use of a DataFlex reserved keyword in the WSDL that ends up in a struct.
In my case I just rename the field and be on with it.
Not sure if it is bug or feature, but it sure was confusing the first time I bumped into it.
--
Wil
Re: PSA: Don't use the word PageBreak as a struct member
Hi Wil,
It kinda sucks when you are calling a web service that returns a json to you, and you try to deserialize that json string to a struct. Since we can't really "decorate" the struct like in C#
[Code]
[JsonProperty("PageBreak")] // NewtonSoft in C#
public string myPageBreak { get; set; }
[/Code]
You are kinda stuck cause you can't exactly rename your struct member, or the json string is not gonna be deserialized into the struct correctly.
Frank Cheng
Re: PSA: Don't use the word PageBreak as a struct member
have posted about this a long time ago. We need proper decorations to rename and classify struct members
Re: PSA: Don't use the word PageBreak as a struct member
It also doesn't help that Structs are global.