Ajesh
1st November 2012, 06:42
Hi All

I am Trying to create a File from Baan. I am using the operations seq.open, seq.puts and seq.close operations but the file is not getting created.

My Code is as below



file.name = num.to.date$(date.num(),3)
file.pointer = seq.open(file.name,"w+",form.path)
update.desc = enum.descr$("tcyesno",form.update)
file.input = " Update = " & update.desc & ", " & str$(date.num()) &
" " & str$(time.num()) & ", "
ret.val = seq.puts(file.input, file.pointer)
file.input = "Installation,Sales Order,Line"
ret.val = seq.puts(file.input, file.pointer)



I have used seq.close later in the Codes too. All the Return values are good.

Anybody with some Clue?

Regards
Shinoj

bdittmar
1st November 2012, 10:31
Hi All

I am Trying to create a File from Baan. I am using the operations seq.open, seq.puts and seq.close operations but the file is not getting created.

My Code is as below



I have used seq.close later in the Codes too. All the Return values are good.

Anybody with some Clue?

Regards
Shinoj

Hello,
are you sure, the RETURN value of :

file.pointer = seq.open(file.name,"w+",form.path)

is OK ?

To check, try to create the file in users HOME .

Regards

wonderkid
1st November 2012, 10:52
- since u have given only the filename... the file must b created in home dir..

- check the permission of the folder wer u r creating the file...

BaanInOhio
1st November 2012, 17:51
What are your default date separators? num.to.date$ mode = 3 will provide a date with separators. You will probably have a problem if the separator is a "/". Might want to try with mode = 0 to get the date without separators.

Also, check for your file pointer > 0 right after 'seq.open' and only perform file operations when > 0.

You probably don't need "w+" for openmode if you don't intend to read the file. If you are adding entries at the end of an existing file, you should use "a" for the openmode instead ("at" if the file is created for windows OS).

Ajesh
2nd November 2012, 06:19
Actually when i gave the file name along with the whole path it made a difference.Otherwise the file was getting created in my Default Home Directory..

Needless to say the Return values were quite correct.


Thanks for all your Replies.