Focal Point
[SOLVED] length of a string

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4501046403

October 30, 2008, 04:34 AM
expertomad
[SOLVED] length of a string
hello good days I would like to know how to get the length of a string with a example
very thanks good day

This message has been edited. Last edited by: Kerry,
October 30, 2008, 05:07 AM
<JG>
Both the method and examples are in the documentation which you access by clicking the help button
in developers studio.

Alternativly search for the word length in the forum using the search tab you will find 789 items to
look at where you will almost certainly find what you need
October 30, 2008, 05:49 AM
expertomad
hello in the documentation use CAMPO/I10=lenght(NAME);
BUT I WANT THAT THE FIELDLS GT 10 ARE EDIT FIELD... ELSE THAT ARE GOOD YOU UNDESRTAND

IN SPANISH
YO QUIERO CALCULAR EL LARGO DEL CAMPO PARA QUE CUANDO EL CAMPO SEA MAYOR QUE 10 SE PUEDA EDITAR Y PONER ... Y SI ES MENOR QUE 10 SOLO SE VEA EL CAMPO Y no se como hacerlo
mucahas gracias
October 30, 2008, 07:13 AM
Tony A
Do you mean that you want to apply an EDIT to those fields that are greater than 10 characters in length? If so then just apply an EDIT mask of 10 chars or use SUBSTR.

En español

¿Quiere decir que desea aplicar un EDIT a los campos que son más de 10 caracteres de longitud? Si es así entonces solo se aplica una máscara de EDIT, de 10 caracteres o el uso SUBSTR.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 30, 2008, 07:34 AM
expertomad
hello tony .
example
DEFINE FILE H_BEBENE
CAMPO/I10=LENGHT(ENTIDAD_TRASLADO);
IF CAMP0 GT 10 THEN GOTO EN ELSE SAL;
-EN
ENTIDAD_TRASLADO/A100=EDIT(ENTIDAD_TRASLADO,'9999999999...$$$$$$$$$$');
-SAL
END
VALUE OF ENTIDAD_TRASLADO
RESULT
CEPAIM ...
CRUZ ROJA ...
LA CALLE ...
MINISTER HOLA ADIOS...

I WANT

CEPAIM
CRUZ ROJA
LA CALLE
MINISTER HOLA ADIOS...
PLEASE YOU CAN HELP ME
THANKS
October 30, 2008, 09:33 AM
Tony A
Please update your signature.

Firstly, you are trying to use field values (CAMPO) with dialogue manager which is not correct.

Secondly, LENGTH is maintain syntax and NOT reporting. ARGLEN is the reporting alternative(ish).

Thirdly you could use the result of CAMPO in a SUBSTR function

TABLE FILE CAR
PRINT MODEL
      COMPUTE MODEL_LEN/I10 = ARGLEN(24, MODEL, 'I10');
	  COMPUTE NEW_MODEL/A24 = SUBSTR(24, MODEL, 1, MODEL_LEN, MODEL_LEN, NEW_MODEL);
   BY MODEL
IF RECORDLIMIT EQ 10
END

This is all quite basic coding - have you had any traning?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 30, 2008, 10:50 AM
expertomad
yes i have a traning more thanks .
but i don't see the solution because my englis is a little and i don't can to explain .
good day and more thanks
October 31, 2008, 02:59 PM
ira
EXPERTOMAD - I will try to translate what Tony said in Spanish, lastly try to get some training.
Lo primero que necesita es una cuestión cuadro de mando contra el auto de archivo (como ejemplo).
la sintaxis de archivo de la tabla de coche
a continuación, imprimir el modelo y calcular su longitud utilizando la sintaxis de la ARGLEN y SUBSTR usuario por escrito subrutinas:
COMPUTE MODEL_LEN/I10 = ARGLEN(24, MODEL, 'I10');
COMPUTE NEW_MODEL/A24 = SUBSTR(24, MODEL, 1, MODEL_LEN, MODEL_LEN, NEW_MODEL);
ordenada por el verbo objeto. en este ejemplo es: modelo
seguido por fin en una línea por sí mismo
por último, tratar de obtener algún tipo de formación

Tener un buen día

Ira


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0