Page 1 of 1 1
Topic Options
#28385 - 2002-09-04 09:42 AM weird read write/put problem
Lord_mithril Offline
Fresh Scripter

Registered: 2002-09-04
Posts: 26
i got a weird problem.
im kind of an n00b with this so dont blame if its really stupid [Smile]

im trying to make an automated mail script.. the mail part works. but i want it to read the body text from a textfile.
i got it to read and write, but i have a weird problem with that.
with the following code it only write's the last line.
and if i put the bold line anywhere else it just does nothing

code:
Open(1, "E:\kix\text.txt",2)  
While @ERROR = 0
[B]$= OLEPutProperty($objItem, "Body", "s", "$x"[/B]
$x = ReadLine(1)
Loop
Close (1)

i treid it a bit different and now it only writes the first line

code:
Open(1, "E:\kix\text.txt",2)   
While @ERROR = 0
$x = ReadLine(1)
MessageBox("$x",dom,0,)
Loop
$= OLEPutProperty($objItem, "Body", "s", "$x") Close (1)

i tried multiple sites and books but i cant find a damn thing [Frown]

Top
#28386 - 2002-09-05 12:37 AM Re: weird read write/put problem
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You are overwriting each line read.
code:
if Open(1, "E:\kix\text.txt",2) = 0
$x = ReadLine(1)
While @ERROR = 0
$x = $x + " " + ReadLine(1)
Loop
$= OLEPutProperty($objItem, "Body", "s", "$x") Close (1)
endif

Maybe you want to add @CRLF instead of a space between lines.

[ 04. September 2002, 13:38: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#28387 - 2002-09-04 01:08 PM Re: weird read write/put problem
Lord_mithril Offline
Fresh Scripter

Registered: 2002-09-04
Posts: 26
that did it .. thanks [Smile]
i just replaced the @CRLF with Chr(13) + Chr(10)
for some reason he didnt understand the macro...
buts i thank thee [Smile]

Top
#28388 - 2002-09-04 03:37 PM Re: weird read write/put problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Which version of KiXtart do you use? I believe the @CRLF macro was added in KiXtart 4.02.
_________________________
There are two types of vessels, submarines and targets.

Top
#28389 - 2002-12-04 07:47 PM Re: weird read write/put problem
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

For an actual list of introduction of new kixtart commands, functions or macros can be find
on our site.
The related link is release.htm

Scriptlogic shows also interesting information in their Development Report
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#28390 - 2002-12-04 07:50 PM Re: weird read write/put problem
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Also the different kixstrip version will tell you which macros are available
in a specific kixtart release.
Also it can handle commands, functions and macros which became obsolete.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.139 seconds in which 0.074 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org