From 2803d0eb7f5c3aec7f8e4bbb7972d94626755e7e Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Tue, 19 Nov 2024 18:28:30 +0100 Subject: [PATCH] Downport optional parameter fix to 4.3 (#316) see #315 --- src/YaNco.Core/Internal/Api.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/YaNco.Core/Internal/Api.cs b/src/YaNco.Core/Internal/Api.cs index 313b1333..e7b5879c 100644 --- a/src/YaNco.Core/Internal/Api.cs +++ b/src/YaNco.Core/Internal/Api.cs @@ -130,7 +130,7 @@ public static RfcRc AddFunctionParameter(FunctionDescriptionHandle descriptionHa Name = parameterDescription.Name, Type = parameterDescription.Type, Direction = parameterDescription.Direction, - Optional = parameterDescription.Optional ? 'X' : '\0', + Optional = parameterDescription.Optional ? '1' : '0', Decimals = parameterDescription.Decimals, NucLength = parameterDescription.NucLength, UcLength = parameterDescription.UcLength, @@ -158,7 +158,7 @@ public static RfcRc GetFunctionParameterDescription(FunctionDescriptionHandle de { var rc = Interopt.RfcGetParameterDescByName(descriptionHandle.Ptr, name.ToUpperInvariant(), out var parameterDescr, out errorInfo); parameterInfo = new RfcParameterInfo( - parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 'X'); + parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 1); return rc; } @@ -168,7 +168,7 @@ public static RfcRc GetFunctionParameterDescription(FunctionDescriptionHandle de { var rc = Interopt.RfcGetParameterDescByIndex(descriptionHandle.Ptr, (uint)index, out var parameterDescr, out errorInfo); parameterInfo = new RfcParameterInfo( - parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 'X'); + parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 1); return rc; }