gpt4 book ai didi

c# - 将列表或数组从 Arden MLM 传递到 C#

转载 作者:太空宇宙 更新时间:2023-11-03 23:24:52 26 4
gpt4 key购买 nike

我很难在 Arden MLM 中找到有关列表和数组的文档。

我正在尝试使用 ObjectsPlus 将 4 位数字的列表从 Arden 传递到 C# DLL,该 DLL 可以将该列表作为参数并执行函数的设计目的。

这是我在 Arden MLM 中拥有的内容,但无法正常工作,因为我收到 .net 错误“对象引用未设置为对象的实例”

这是传销:

list_id_object       := OBJECT [id_list_holder];
id_list := new list_id_object with "1154", "1155", "1158";

try
send_alert_start := new net_object 'Webservices';
result := call send_alert_start.'pageToMultipleIds' with
((sender_name as string) as 'String'),
((sender_message as string) as 'String'),
((list_id_object as list) as 'List<Int32>');
endtry;
catch Exception ex
error_occured := true;
error_message := "Error message here\n" || ex.Message || "\n\n";
endcatch;

这是接收该列表的 C# 方法:

public string testMethod(string sender_name, string sender_message, List<Int32> IdToPage)
{
try
{
testMethod2(sender_name, sender_message, IdToPage);
return "Success";
}
catch(WebException e)
{
return e.ToString();
}
}

最佳答案

这是为 Allscripts SCM 编写的,但它应该展示如何构建列表。不幸的是,您必须创建一个标准的 Arden 列表,然后遍历它并将每个项目添加到列表中。

std_include_libs := mlm'std_include_libs';
include std_include_libs;

id_list := 1154, 1155, 1158;

try;
using "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using namespace "System.Collections.Generic";
idList := new net_object 'List<Int32>';
for i in id_list do
void := call idList.'Add' with i as 'Int32';
enddo;

send_alert_start := new net_object 'Webservices';
result := call send_alert_start.'pageToMultipleIds' with ((sender_name as string) as 'String'),
((sender_message as string) as 'String'),
idList;
endtry;
catch Exception ex;
error_occurred := true;
error_message := "Error message here\n" || ex.Message || "\n\n";
endcatch;

关于c# - 将列表或数组从 Arden MLM 传递到 C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34182346/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com