rupertb
14th October 2002, 16:56
Does any one have an intelligent routine that can split the item master description (50 char) to 2 lines of 18 char. Not just at position 18, the line wrapping should make sense.

Example: BETNESOL N EYE/EAR/NOSE DROPS 10ML
line 1: BETNESOL N EYE/EAR
line 2: /NOSE DROPS 10ML

Thanks,
Rupert

jaapzwaan
14th October 2002, 17:51
Rupert,

The first line has a maximum of 18 characters and so does the second line? WHat if there are more than 36 characters in the string?

Anyway, you should do something with http://www.baanboard.com/programmers_manual_baanerp_help_functions_string_operations_pos_rpos on position 18:
This should be something like (not compile, just typed here):


long p

p = max(rpos(item(1;18), " "), rpos(itme(1;18),"/")
| more test here for checking if p is not too small

line1=item(1;p-1)
line2=item(p)


Regards,
Jaap Zwaan

rupertb
15th October 2002, 09:29
Thanks Jaap that's the method I'm using.

Rupert