Source language: Translate to:

FileWrite and FileToVar

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

FileWrite and FileToVar

Postby Alex » Tue Mar 06, 2007 12:58 pm

Hi,

It is normal that I have to do :

Setvar "[FileToVar]" "C:\WINDOWS\jkw.log"
FileToVar "[FileToVar]" "[Doc]"

and

Setvar "[FileWrite]" "C:\WINDOWS\jkw.log"
FileWrite "[FileWrite]" "All" "[Result]"


Or I can do

FileToVar "C:\WINDOWS\jkw.log" "[Doc]"

and

FileWrite "C:\WINDOWS\jkw.log" "All" "[Result]"


Because it's not working for me.


Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby remlap » Tue Mar 06, 2007 6:05 pm

FileWrite "C:\WINDOWS\jkw.log" "All" "[Result]"


Providing you have some data in the variable [Result], it will be written to the file, but it isn't clear from examples that [Result] contains anything?
User avatar
remlap
 
Posts: 141
Joined: Thu Jun 09, 2005 5:23 pm
Location: Lincolnshire, England

Postby Alex » Wed Mar 07, 2007 12:25 am

Hi,

My doc has 1 line and nothing appar in the [Result] I have to do :

Setvar "[FileWrite]" "C:\WINDOWS\jkw.log"
FileWrite "[FileWrite]" "All" "[Result]"


Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby remlap » Wed Mar 07, 2007 3:27 am

Well if your variable, [Result] has a null value, it should come as no surprise that you are writing nothing to the file. I think I may be missing something, as I have no idea as to what you are trying to acheive?
User avatar
remlap
 
Posts: 141
Joined: Thu Jun 09, 2005 5:23 pm
Location: Lincolnshire, England

Postby Gaev » Wed Mar 07, 2007 5:19 am

Alex:
My doc has 1 line and nothing appar in the [Result] I have to do :

Setvar "[FileWrite]" "C:\WINDOWS\jkw.log"
FileWrite "[FileWrite]" "All" "[Result]"

a) What do you mean by my doc ? ... C:\WINDOWS\jkw.log ? ... or the variable [doc] you mentioned in your previous post ?

b) Do you know that in the FileWrite command above, the contents of the variable [Result] will be written to the file C:\WINDOWS\jkw.log ?

c) Try this first ...
Code: Select all
Setvar "[FileWrite]" "!C:\WINDOWS\jkw.log"
AlertBox "Before FileWrite" "File=[FileWrite]|Result=[Result]"
FileWrite "[FileWrite]" "All" "[Result]"
Run "c:\windows\notepad.exe" "![FileWrite]" "Normal" "" ""

i) Note the use of the ! character before the name of the file.

ii) verify that the file name and value in [result] are as expected.

iii) verify that notepad.exe shows the same content.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Thu Mar 15, 2007 4:39 am

Thanks Gaev
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: Dudus and 1 guest