1

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

我正在尝试使用 ObjectsPlus 将 Arden 的 4 位数字列表传递给 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();
            }
    }
4

2 回答 2

3

这是为 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;
于 2016-01-15T23:22:54.103 回答
0

请参阅下面的更改。

((list_id_object as list) as 'List<Int32>');

变成

((list_id as list) as 'List<Int32>');

.

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 as list) as 'List<Int32>');
endtry;
catch Exception ex
    error_occured := true;
    error_message := "Error message here\n" || ex.Message || "\n\n";
endcatch;
于 2015-12-31T13:01:27.697 回答