Wednesday, September 08, 2010     | Register
TradersStudio Forums
Subject: Parameters of function TrStfileopen

You are not authorized to post a reply.   
Author Messages
Gewinner
Posts:9

07-12-2009 7:02 AM Alert 
TrStfileopen requires two parameters.

The filenamepath and a second one, which is not documented in the Language help.

It seems that it has to be 0 for read access and 2 for write access.

In the function ReadFileLines(FileNamePath As String) it is done like this:
        FileNum = trstfileopen(FileNamePath,FileNum)
In this function FileNum is not initialized explicitly, but assumedly implicitly to 0. This function should be improved.

Please explain the second parameter of TrStfileopen.
murray
Posts:519

07-12-2009 10:48 AM Alert 

It should not be filenum there it should be the mode we open the file in

1 is read only

2 is open for appending new data, this will also create it if needed.

Gewinner
Posts:9

07-13-2009 4:52 PM Alert 

This script does not run with the browser SeaMonkey.

I tried both 0 and 1.

I still believe in a 0 for read only access.

1 results into a run-time error (#52).

Maybe it depends on the machine, where TS is running on. I willl try my other tomorrow.

murray
Posts:519

07-14-2009 12:52 PM Alert 

What do you mean Seamonkey browser ?. What does that have to do with a TradersStudio script.

 

We are checking into file issue will update in a day or so with example code.

You are not authorized to post a reply.
Forums > TradersStudio 2.x > TradersStudio Basic > Parameters of function TrStfileopen



ActiveForums 3.6
TradersStudio® Copyright 2004-2010 All Rights Reserved   |  Privacy Statement  |  Terms Of Use