Page 1 of 1

info onthe piece of code

Posted: Wed Feb 07, 2007 12:01 am
by parvathi
Hi all,

I have to write to an xml file about the job in to a directory.
what does the t.fvar mean . what does it do?
does
write ReportText to t.fvar, v_JobreportFileName else

sufficient to write the full information

please help me on this


Openpath v_logFolder to t.fvar then
write ReportText to t.fvar, v_JobreportFileName else
call DSLogWarn("Failed to write file ":v_JobreportFileName)
end
end
else
call DSLogWarn("Failed to open directory ")
end

close t.fvar

Posted: Wed Feb 07, 2007 2:31 am
by ray.wurlod
Not really, unless you can show us how the v_... variables and the ReportText variable get their values. DSLogWarn requires two arguments. There's no value trying to close a file if you failed to open it.
The variable "t.fvar" is what's called a "file variable" or "file handle" - effectively a pointer to a structure that all other I/O statements must use.

Please enclose your code in Code tags as follows to preserve indenting.

Code: Select all

Openpath v_logFolder to t.fvar Then 
   Write ReportText to t.fvar, v_JobreportFileName Else 
      Call DSLogWarn("Failed to write file ":v_JobreportFileName, "MyRoutine") 
   End 
   Close t.fvar 
End 
Else 
   Call DSLogWarn("Failed to open directory ", "MyRoutine") 
End