inbound
TRANSCRIPT
![Page 1: Inbound](https://reader036.vdocuments.net/reader036/viewer/2022082422/55cf9339550346f57b9cea80/html5/thumbnails/1.jpg)
Local File &myfile;
Local array of string &myarray;
Local string &text;
Local Record &rec;
&myfile = GetFile("C:\Documents and Settings\Administrator\Desktop\office.txt", "r", %FilePath_Absolute);
&myarray = CreateArrayRept("", 0);
&rec = CreateRecord(Record.IN1_TBL);
If &myfile.IsOpen Then
While &myfile.ReadLine(&text);
&myarray.Push(&text);
&myarray = Split(&text, ",");
&rec.IN1_NAME.Value = &myarray [1];
&rec.IN1_LOCATION.Value = &myarray [2];
&rec.Insert();
End-While;
End-If;
&myfile.Close();
Or
Local File &MYFILE;
Local Record &REC;
Local array of string &ARRAY;
&MYFILE = GetFile("R:\psoft\hr89\IPT.TXT", "R", %FilePath_Absolute);
&REC = CreateRecord(Record.RECD);
&ARRAY = CreateArrayRept("", 0);
If &MYFILE.IsOpen Then
![Page 2: Inbound](https://reader036.vdocuments.net/reader036/viewer/2022082422/55cf9339550346f57b9cea80/html5/thumbnails/2.jpg)
If &MYFILE.SetFileLayout(FileLayout.RECD_FL) Then
While &MYFILE.ReadLine(&STRING);
&ARRAY = Split(&STRING, ",");
For &I = 1 To &REC.FieldCount
&REC.GetField(&I).Value = &ARRAY [&I];
End-For;
/* Additional processing */
&REC.Insert();
End-While;
Else
/* Message – filelayout not correct */
End-If;
Else
/* Message – file not open */
End-If;
&MYFILE.Close();