GeneXus - Ficheros TXT

 
Vista:

Ficheros TXT

Publicado por Jose Mª (1 intervención) el 03/09/2003 13:09:13
Alguien me puede comentar como leer y escribir ficheros ascii en genexus, no se que instrucciones utilizar.

Un saludo y gracias de antemano
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ficheros TXT

Publicado por Federico (120 intervenciones) el 19/09/2003 23:15:37
Creo que no hay funciones en genexus para eso. Por eso tenes que usar programas externos. La invocacion al programa externo es mediante el call y el nombre del programa externo entre comillas simples.
Ej:
call('eleer' ,&archivo,&texto)
siendo en este caso eleer.prg.

Saludos Atte.
Federico Gordillo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ficheros TXT

Publicado por Hector (1 intervención) el 21/09/2003 04:47:52
Hay varias maneras, una es utilizar la instruccion VB dentro del codigo genexus para que te ejecute sentencias nativas de Visual Basic, si vas a generar para foxpro u otro xbase entonces usa la sentencia DBASE,
la otra forma es utilizar un IGX para registrar un programa externo hecho en VB y que lo podas llamar directamente desde el codigo GX, en gxopen existe tambien un proyecto que te permite hacer esto y te da un ejemplo. Otra forma es estableciendo el TXT con un data view, en la GXLIBRARY te explica y te da un ejemplo. Tambie se que hay unas funciones GX no documentadas en la version 7 y 7.5 que te permite hacer esto pero que no estan el manual sin embargo cuando estes escribiendo el codigo podes dar call(gx pulsas f1 y alli te salen.
Si tenes problemas dame un email.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ficheros TXT

Publicado por [email protected] (1 intervención) el 12/12/2005 20:32:47
DFRGTxt Function
Scope
Objects: Procedures, Reports, Transactions, Web Panels, Work Panels

Languages: .NET, C/SQL, Java, Visual Basic

Interfaces: Web, Win

Purpose
Reads a character type field of the current line (read by dfrnext).

Syntax
DFRGTxt( Text [, Length])



Type Returned:

Numeric



Where:

Text

It can be an attribute or variable or character or varchar type. The read value will be stored here.



Length

It can be an attribute, variable or constant of numeric type, optional, which indicates the maximum number of characters to be read. Their value, if specified, can’t exceed the size defined for <txt>. In case it is omitted, it is assumed the size defined for the attribute or variable <txt>. If this parameter exceeds the <txt> size the results are unpredictable.

NOTE: If the parameter encoding was specified in the function DFROpen, this length means “number of bytes”.

Values
This function may return some of the following values:

0: Sucessful operation. The field has been read.

-1: Wrong sequence. It occurs when you call this function before calling the dfrnext function or the last call to dfrnext returned a value different from zero (error). If the trace is enabled you will see the ADF0004 or ADF0006 message.

-5: Wrong format. The string in the field doesn’t have a correct form. The most common cause is that the field you are trying to read is of another type (number, date, etc.). If the trace is enabled you will see the ADF0009 message.

-6: Overflow. This is a warning that indicates that the string length in the record is greater than the maximum specified (or assumed) in the <length> parameter. The value read is cut to <length> characters
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar