#28385 - 2002-09-04 09:42 AM
weird read write/put problem
|
Lord_mithril
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
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
|
|
Top
|
|
|
|
#28386 - 2002-09-05 12:37 AM
Re: weird read write/put problem
|
Howard Bullock
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 ]
|
|
Top
|
|
|
|
#28387 - 2002-09-04 01:08 PM
Re: weird read write/put problem
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
that did it .. thanks i just replaced the @CRLF with Chr(13) + Chr(10) for some reason he didnt understand the macro... buts i thank thee
|
|
Top
|
|
|
|
#28389 - 2002-12-04 07:47 PM
Re: weird read write/put problem
|
MCA
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.
|
|
Top
|
|
|
|
#28390 - 2002-12-04 07:50 PM
Re: weird read write/put problem
|
MCA
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.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|