pralash
3rd August 2017, 14:49
Hi,
I'm fresher to LN. I want to be right a string into the file. But I can't do it.
I think is there any header file is needed to this operation, I have mentioned my script below.

Thanks
Pralash...

function void file.creation.for.string.to.text.domain.conversion(string tmp.string)
{

domain tcmcs.long ft

| #include <bic_text>

file.tmp = creat.tmp.file$(bse.tmp.dir$() ) |create temp file Aug 3
ft = seq.open(file.tmp,"w") |open file with write method
|retn = seq.puts(tmp.string,ft) |tmp.string is your input text
retn = seq.puts("senthil",ft) |tmp.string is your input text
seq.close(ft)
}

bhushanchanda
3rd August 2017, 14:59
Hi,

What error are you getting on compiling the script?

Couple of observations -

1. Check if "file.tmp" variable is defined
2. string tmp.string should be something like string tmp.string(1024)

You should not need any includes to use any of these functions.

Also, moved the thread to correct forum - Tools Development.

pralash
3rd August 2017, 15:37
Hi,
Script is compiles successfully...
As you suggested, I already declared tmp.file and tmp.string....
But the files are created in c:\erpln\temp path... but the file doesn't contain
the writing information.

Can you please help to fix this...
Thanks,
Pralash

bdittmar
3rd August 2017, 16:17
Hello,
just an example.

|DECLARATION:

extern string l_datensatz(500)
extern long fpl, errl |Filepointer



|Open labelfile for writing
fpl = seq.open(<your file>, "w")


|Write 1st line with userinformation
l_datensatz = "User:"&logname$
errl = seq.puts(l_datensatz, fpl)

|Write 2nd line with Sentinel labelname
l_datensatz = "LAB_NAME ="&"BGL_PR00087.lab"
errl = seq.puts(l_datensatz, fpl)

|Built an empty line
l_datensatz = ""
errl = seq.puts(l_datensatz, fpl)

|Built the Header Line (variable names)
l_datensatz =
"ART_NR;REV;Bezeich;KW;Jahr;SFC;BCODE;count"
errl = seq.puts(l_datensatz, fpl)

|Close the dataset file
errl = seq.close(fpl)


Regards

bhushanchanda
3rd August 2017, 16:54
Hi,
Script is compiles successfully...
As you suggested, I already declared tmp.file and tmp.string....
But the files are created in c:\erpln\temp path... but the file doesn't contain
the writing information.

Can you please help to fix this...
Thanks,
Pralash

Pralash,

Can you post your complete code? How are you declaring tmp.file?

pralash
10th August 2017, 14:01
I have fixed the issue....
Thanks for your information...
Regards,
Pralash

bhushanchanda
10th August 2017, 14:55
Glad that you got it solved.

Please share the problem and the solution you came up with. It will help others or may be will help you in future.