Page 1 of 1

\"Write into Text File\" query/problem...

Posted: Mon Dec 13, 2004 12:00 pm
by [MS]Mark
I have the following lines in a script:

Code: Select all

Write into Text File $TARGETDIR$\\Settings.dat from Value $ODBCLOC$ (at start of file)
Write into Text File $TARGETDIR$\\Settings.dat from Value 1.2.3.4 (at end of file)
Write into Text File $TARGETDIR$\\Settings.dat from Value username (at end of file)
Write into Text File $TARGETDIR$\\Settings.dat from Value password (at end of file)


expecting Settings.dat to be:

Code: Select all

C:\\Database
1.2.3.4
username
password


but I'm getting:

Code: Select all

C:\\Database
C:\\Database




1.2.3.4
username
password
1.2.3.4
username
password


(there 4 blank lines between the first 2 copies of $ODBCLOC$ and the 1.2.3.4 address)...

Any ideas on what's going wrong or how to achieve a text file with those 4 lines in it?

Thanks :)

/edit - setting them to all Start of file gives:

Code: Select all

password
username
1.2.3.4
C:\\Database
C:\\Database
C:\\Database




1.2.3.4
username
password
1.2.3.4
username
password

Posted: Mon Dec 13, 2004 5:19 pm
by sinan
That is very odd.
I ran several tests here. I was unable to reproduce the issue. If you send me your script, I might be able to make a few suggestions.

I got:

Code: Select all

C:\\Database
C:\\Database
C:\\Database
1.2.3.4
username
password
1.2.3.4
username
password
1.2.3.4
username
password


Something may be up with the value of your $ODBCLOC$ variable?

Posted: Tue Dec 14, 2004 3:51 am
by [MS]Mark
changed the code to do:

Code: Select all

Write into Text File $TARGETDIR$\\Settings.dat from Value  $ODBCLOC$$NEWLINE$1.2.3.4$NEWLINE$username$NEWLINE$password (at start of file)


and now outputs:

Code: Select all

C:\\Database
1.2.3.4
username
password
C:\\Database
1.2.3.4
username
password


which is getting somewhere but still can't see why it's outputting twice :?:

Posted: Tue Dec 14, 2004 6:10 am
by sinan
I really don't know :| If you send me your script I might be able to help more.

Posted: Tue Dec 14, 2004 7:06 am
by [MS]Mark
files sent :)