igorrino
29th May 2008, 18:43
The problem is that i insert a text field of 300 characters in a text, my intention is to store data in the tttxt010 but this function only save the data in the tttxt001. Not save anything in the ttxt002 and ttxt010

function crear.texto(domain tcmcs.s300m texto)
{
extern domain tttxt.buf test
extern string nom.fichero(100)
extern long fichero
extern string comando(25)
extern long t
extern long txt.name
domain tcmcs.str17 kw1
domain tcmcs.str17 kw2
domain tcmcs.str17 kw3
domain tcmcs.str17 kw4
kw1 = "Cliente"
kw2 = strip$(shiftl$(tcxco907.cuno))

nom.fichero= "f:\erpln\tmp\" & str$(pid) & ".txt"
texto = strip$(shiftl$(texto))
texto="hola"
fichero = seq.open(nom.fichero,"w")
seq.puts(strip$(shiftl$(texto)),fichero)
seq.close(fichero)

|t = text.write("txt.name", strip$(shiftl$(tcxco907.clan)), kw1, kw2, kw3, kw4, "text", "text",nom.fichero)
t = text.write("txt.name", "5", kw1, kw2, kw3, kw4, "text", "text",nom.fichero)
texto=strip$(shiftl$(texto))
fichero = file.rm(nom.fichero)
}

bdittmar
30th May 2008, 09:32
The problem is that i insert a text field of 300 characters in a text, my intention is to store data in the tttxt010 but this function only save the data in the tttxt001. Not save anything in the ttxt002 and ttxt010

function crear.texto(domain tcmcs.s300m texto)
{
extern domain tttxt.buf test
extern string nom.fichero(100)
extern long fichero
extern string comando(25)
extern long t
extern long txt.name
domain tcmcs.str17 kw1
domain tcmcs.str17 kw2
domain tcmcs.str17 kw3
domain tcmcs.str17 kw4
kw1 = "Cliente"
kw2 = strip$(shiftl$(tcxco907.cuno))

nom.fichero= "f:\erpln\tmp\" & str$(pid) & ".txt"
texto = strip$(shiftl$(texto))
texto="hola"
fichero = seq.open(nom.fichero,"w")
seq.puts(strip$(shiftl$(texto)),fichero)
seq.close(fichero)

|t = text.write("txt.name", strip$(shiftl$(tcxco907.clan)), kw1, kw2, kw3, kw4, "text", "text",nom.fichero)
t = text.write("txt.name", "5", kw1, kw2, kw3, kw4, "text", "text",nom.fichero)
texto=strip$(shiftl$(texto))
fichero = file.rm(nom.fichero)
}

Hello,

that's text.write :

text.write()

--------------------------------------------------------------------------------

Syntax
long text.write( string text_field(17), string lang, string kw1(17), string kw2(17), string kw3(17), string kw4(17), string tgroup(8), string edit_opt(15), string tmp_file(256) [, long bidi] )

Description
This adds a new text to the text manager and assigns a new text number to the text.

Arguments
text_field
The name of the new text field. See Text fields: overview. This returns the text number for the new field.

lang
This specifies the language for the new text.

kw1 to kw4
Use these arguments to specify key words for the text.

tgroup
This specifies the name of the text group to which the text must be assigned. If you specify an empty string here, the text is assigned to the user's default group.

edit_opt
This specifies the type of window in which the text must be displayed.

tmp_file
The name of the file where the text for the new field is stored.

bidi
Use this optional argument to indicate the text alignment. Possible values are:

true text is right justified
false text is left justified; this is the default option


Return values
>0 success; returns the number of lines written
-1 error

Regards