gvSIG bugs #3062

Poder usar los corchetes en expresiones de cadena en la calculadora de campos.

Added by Joaquín del Cerro Murciano over 9 years ago. Updated over 9 years ago.

Status:Closed% Done:

0%

Priority:LowSpent time:-
Assignee:Joaquín del Cerro Murciano
Category:Document table
Target version:2.1.0-2263
Severity:Minor Add-on version:
gvSIG version:2.1.0 Add-on build:
gvSIG build:2260 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch:Yes Hito:
Add-on name:Unknown

Description

Corregir el evaluador de expresiones de la calculadora de campos para que reemplace la evaluacion de los campos de forma mas inteligente y permita usar los corchetes en las expresiones cuando no se estan usando para referenciar un campo.
Por ejemplo, la expresion:

  [CAMPO1][:10]

Deberia ser valida y devolver los primeros 10 caracteres del campo "CAMPO1".

gvSIG.log (491 Bytes) Álvaro Anguix, 12/19/2014 10:22 AM

expression.patch Magnifier (1.56 KB) Antonio Falciano, 01/13/2015 07:21 PM


Related issues

Related to Application: gvSIG desktop - gvSIG bugs #3102: Invalid syntax in Field Calculator Closed 01/10/2015
Related to Application: gvSIG desktop - gvSIG feature requests #2279: Add regex function(s) in the string functions of Field Ca... Closed 02/03/2014

Associated revisions

Revision 38
Added by Joaquín del Cerro Murciano over 9 years ago

refs #3062, Corregido el evaluador de expresiones de la calculadora de campos para que reemplace la evaluacion de los campos de forma mas inteligente y permita usar los corchetes en las expresiones cuando no se estan usando para referenciar un campo.

Revision 43
Added by Joaquín del Cerro Murciano over 9 years ago

refs #3102, refs #3062, Corregido la sustitucion de los nombres de campos por la funcion de python, y modificado el panel de avanzado para disponer de un editor en el que introducir codigo en lugar de solo disponer de la opcion de cargarlo desde disco,

History

#1 Updated by Joaquín del Cerro Murciano over 9 years ago

  • Description updated (diff)

#2 Updated by Joaquín del Cerro Murciano over 9 years ago

  • Priority changed from Normal to Low
  • Status changed from New to Fixed

#3 Updated by Álvaro Anguix over 9 years ago

  • gvSIG build set to 2260
  • Target version deleted (2.1.0-2260)
  • Status changed from Fixed to New
  • Category set to Document table
  • File gvSIG.log added

No funciona.
Adjunto log.

#4 Updated by Antonio Falciano over 9 years ago

[CAMPO1][:10]
should be the equivalent of
subString([CAMPO1],0,9)
However, it's not possible to verify if they work at the moment (build 2262), because of #3102.
See also #2452 in reference to substr/subString.

#5 Updated by Antonio Falciano over 9 years ago

A little correction. It should be:

subString([CAMPO1],0,10)
because "The substring begins at the specified parameter2 and extends to the character at index parameter3 - 1."

#6 Updated by Antonio Falciano over 9 years ago

In order to solve this, firstly I'd restore the old behaviour of square brackets (expression.patch).
Then, in order to allow slicing, I'd add two new functions in addiction to SubString: left and right. For instance, in Jython:

def left(string, value):
    return string[:value]

def right(string, value):
    return string[-value:]

#7 Updated by Álvaro Anguix over 9 years ago

  • Has patch set to Yes

#8 Updated by Álvaro Anguix over 9 years ago

#9 Updated by Antonio Falciano over 9 years ago

An extended use of square brackets would be very useful also in the case of regular expressions (see #2279). However, there's the Advanced tab of Field calculator in order to define and add new functions in the expressions.

#10 Updated by Álvaro Anguix over 9 years ago

#11 Updated by Joaquín del Cerro Murciano over 9 years ago

  • Target version set to 2.1.0-2263
  • Status changed from New to Fixed

#12 Updated by Álvaro Anguix over 9 years ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF