Problems with writeln

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Problems with writeln

Post by migro » Sat Dec 01, 2007 7:13 pm

Hi,

I need to delete some lines in a textfile. So I write the lines still needed to a new file. But some of the lines are not complete.

Example_1:
Konfigurationsdaten - Bildpfad: E:\UKH\Work\PDATA, Datenquelle: PDATA_SQLEXPRESS , Computername: PCX00000

is written to the new textfile as:
Datenquelle: PDATA_SQLEXPRESS , Computername: PCX00000

Example_2:
Patientendaten geändert (420): 'Metzler, Dr., Klaus: 8.12.1958, '. Alt: 'Dr.Metzler, Klaus: 8.12.1958, '

is written to the new textfile as:
Dr., Klaus: 8.12.1958, '. Alt: 'Dr.Metzler, Klaus: 8.12.1958, '

Any idea whats going wrong here?
regards
migro

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Sat Dec 01, 2007 7:41 pm

If you could include your wln> code, that might help, but my guess is that you have not used the "result" setting in WLN>

the correct format is:

wln>FileName,result,TheDataToBeWritten

In case the write to the file encounters a problem, the "result" variable will contain a code which might indicate the problem.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Dec 01, 2007 7:43 pm

As you haven't provided your code I will have to guess what the problem might be [Tip - if you want help, help us to help you and provide your code].

Anyway, if I had to guess what the problem is I'd say you've probably missed out the second parameter to WriteLn.

WriteLn takes THREE parameters:

WriteLn>filename,RESULT_VARIABLE,text_to_write

Am I right?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Sat Dec 01, 2007 8:11 pm

Hi,

thanks a lot for the "guess". You are right ;-)

I forgot the result variable ....
regards
migro

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts