Interviewer And Interviewee Guide

SilkTest Interview Question:

While (FileReadLine (hFile, sMailData)) is not doing it for each line of the input file. How do I tell it to go on to the next line and add each string to the list and add the list to the master list of list?

Submitted by: Administrator
While (FileReadLine (hFile, sMailData)) is not doing it for each line of the input file. How do I tell it to go on to the next line and add each string to the list and add the list to the master list of list?

[+] LIST OF LIST OF STRING ParseMailFile ()
[ ] STRING sElement, sLine, sMailData
[ ] HANDLE hFile
[ ] LIST OF STRING lsMailData = {}
[ ] LIST OF LIST OF STRING llsMailData = {}
[ ] rMail Mail
[ ]
[ ] hFile = FileOpen (csDataDir+"Mail.txt", FM_READ)
[-] while (FileReadLine (hFile, sMailData))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 1))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 2))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 3))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 4))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 5))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 6))
[ ] ListAppend(lsMailData, GetField(sMailData, ",", 7))
[ ]
[ ] ListAppend(llsMailData,lsMailData)
[ ]
[ ] FileClose (hFile)
[ ] return llsMailData
[ ]



Just force it to start from first raw before the loop. Should go through each lines.
Submitted by: Administrator

Read Online SilkTest Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.