exist a function???

Posted by rogeliolt on 02-Aug-2012 12:27

exist a function that show me de total long of a field???...

length just say me how many letters I used on a data... but what size hava that field??? can u tell me???

All Replies

Posted by rogeliolt on 02-Aug-2012 17:46

Ok, I search, but I never found it... but, the solution for my problem is this...

def var c like customer.cust_nom.

def var b like customer.cust_nom.

def var ctes like customer.cust_id.

def var i as i.

def var d as i.

update ctes with frame g.

find first customer where customer.cust_id = ctes

                    no-lock no-error.

if available customer then do:

  i = length(customer.cust_nom) + 1.

  do while(i

    i = i + 1.

    d = d + 1.

    c = c + "-".

    b = customer.cust_nom + c.

    display b.

  end.

end.
in OpenEdge 10.1c this is the code...

def var c like customer.cust_nom.

find first customer where customer.cust_cte = "45"

                    no-lock no-error.

if available gecctecc then do:

  c = customer.cust_nom.

  c = customer.cust_nom + fill("-", (65 - length(gecctecc.c_nom))).

  display c.

end.
the result is this...
Original String:
"ROGELIO LOPEZ                                                          "
New String:
"ROGELIO LOPEZ----------------------------------------------------------"

Posted by gus on 03-Aug-2012 08:49

n = length ("some string or another", "raw").

gives you length in bytes. See the language reference.

n = length ("some string or another", "column").

gives length in display columns

This thread is closed