5. Juni 2014 14:12
OpenNotePad(partxtCommentText : Text[250];parvarCR : Variant)
IF intReturnNo = 0 THEN BEGIN
loctxtComment := ASCII2ANSI(partxtCommentText);
IF loctxtComment <> '' THEN
TempOutStream.WRITETEXT(loctxtComment,STRLEN(loctxtComment))
ELSE
TempOutStream.WRITETEXT(loctxtComment);
TempOutStream.WRITETEXT();
END ELSE BEGIN
EVALUATE(locbooCR,FORMAT(parvarCR));
IF locbooCR THEN
loctxtComment := ASCII2ANSI(partxtCommentText)
ELSE
loctxtComment := ASCII2ANSI(partxtCommentText) + ' ';
IF loctxtComment <> '' THEN
TempOutStream.WRITETEXT(loctxtComment,STRLEN(loctxtComment))
ELSE
TempOutStream.WRITETEXT(loctxtComment);
IF locbooCR THEN
TempOutStream.WRITETEXT();
END;
InitializeNotePad()
TempFile.CREATE(FORMAT(TEMPORARYPATH) + STRSUBSTNO('Notepad-%1.txt',USERID));
TempFile.CREATEOUTSTREAM(TempOutStream);
StartEditor()
TempFile.CLOSE;
IF ISCLEAR(WSHShell) THEN
CREATE(WSHShell,TRUE,TRUE);
TempFileName := 'C:\Windows' + '\notepad.exe' + ' ' + TEMPORARYPATH + STRSUBSTNO('Notepad-%1.txt',USERID);
WindowsStyle := 1;
WaitForReturn := TRUE;
locintShellNo := WSHShell.Run(TempFileName,WindowsStyle,WaitForReturn);