BRADSJ
12th October 2010, 16:17
I am getting a compilation warning when i try to compile a report script.

Return value of function 'text.to.buf' ignored.
I am trying to return the 5th line of Item Master text (tiitm001.txta) for language 1.

This is the report script:


declaration:

table ttiitm001 | Items

extern domain tcitem item.f fixed

string text.array(20,5)mb
extern domain tcmcs.str20 itm.txta5 mb

#include "itccom0010" | handle reports
#include <bic_text>
#include <bic_tt>

detail.1:
before.layout:


select tiitm001.*
from tiitm001
where tiitm001._index1 = {:item.f}
order by tiitm001._index1

selectdo

text.array(1,5) = ""

text.to.buf("tiitm001.txta", "1", 5, text.array)
itm.txta5 = text.array(1,5)

endselect

mark_h
12th October 2010, 17:13
It is just a warning - I believe text.to.buf returns the number of lines. So just a warning.

mark_h
12th October 2010, 17:22
Assuming your code works the warning can be ignored. Of course using "item.f" in the details will probably (assuming item.f is for field) will always return the same text. I would expect this to be the item being printed in the layout - whatever variable that is.

loveubaan
15th October 2010, 08:46
indeed, it gives no of lines .....

Syntax
long text.to.buf( string text_field(17), string lang, long nr_lines, ref string buf(,) [, long rtf.text] )

Description
This stores the text of a specified text field in a two-dimensional string array.

Arguments
text_field
The name of the text field that must be retrieved. See Text fields: overview.

lang
This specifies the relevant language.

nr_lines
This specifies the maximum number of lines that can be stored in the buffer.

buf
This specifies the buffer in which the text must be stored.

rtf.text
Set this argument to true if you want the text to be stored in RTF format instead of ASCII format. This is possible only when using a text group that supports RTF data.


Return values
>0 number of stored lines
0 error
- 1 no permission to store the text