[英]How do you loop through text file in C/AL(Navision)
I am trying to create a function that will parse through a text file that has two columns: customer number and file address.我正在尝试创建一个函数,该函数将解析具有两列的文本文件:客户编号和文件地址。 As the function loops through each record in the text file, have it search for a Customer record based upon the first column, and if found, insert a record link whose URL is the value of the file address column.
当函数遍历文本文件中的每条记录时,让它根据第一列搜索客户记录,如果找到,则插入一个记录链接,其 URL 是文件地址列的值。 I am using Microsoft Dynamics NAV so it involves C/AL.
我正在使用 Microsoft Dynamics NAV,因此它涉及 C/AL。 any insights would be much appreciated since I cannot seem to find what I want when I google it.
任何见解将不胜感激,因为我在谷歌搜索时似乎找不到我想要的东西。
Try these:试试这些:
//variable:
//Name: recDir, DataType: Record, Subtype: File(2000000022)
//Name: txtPath, DataType: Text, Length: 100
//coding:
txtPath:='C:\temp\';
recDir.RESET;
recDir.SETRANGE(Path,txtPath);
recDir.SETRANGE("Is a file",TRUE);
IF recDir.FIND('-') THEN BEGIN
REPEAT
MESSAGE('%1',recDir.Name);
UNTIL recDir.NEXT=0;
END;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.