Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 5th September 2018, 09:52
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
delete chars from string
Baan: ERP LN 6.1 FP8 (Infor ERP 10.2)
C/S: Client

hi all,

i should try to delete some characters from a string with certains conditions. If i have that string longer than 20 i have to delete the first characters, until i arrive to 20.
How can i manage it ?

Thanks
Reply With Quote
  #2  
Old 5th September 2018, 09:57
tmannais's Avatar
tmannais tmannais is offline
Member
 
Join Date: Jul 2017
Posts: 77
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
Try

Code:
output = str.substring$(your.string, len(your.string) - 20, len(your.string))
not tested though. Feel free to adjust where it needs to be done.
Reply With Quote
  #3  
Old 5th September 2018, 11:08
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
Hi,

thanks, but i've found also this way:

lng = len(trim$(field))

lng2 = 20

if lng > 20 then
diff = lng - lng2
field = field(diff;20)
endif

cheers,

Last edited by Svidos29 : 6th September 2018 at 12:14.
Reply With Quote
  #4  
Old 11th September 2018, 20:05
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,064
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
Since you are on the 10.2 release you can use the Standard Tools function -
Quote:
str.remove$()
Syntax:
function string str.remove$ (const string string$, long offset, long nchars)

Description

Returns a copy of a string having a number of characters deleted, beginning at a specified character position.

Arguments
const string string$ a string

long offset the character position to begin deleting characters; note that:

if offset < 1, then nothing is removed
if offset > len(string$), then nothing is removed

long nchars the number of characters to remove; note that:

if nchars < 0, then all characters starting at offset are removed
if nchars = 0, then nothing is removed
if offset + nchars > len(string$), then all characters starting at offset are removed

Return values
A string equivalent to the specified string less the specified number of characters

Context
This function is implemented in the 4GL Tools and can be used in all script types. This function is available from TIV level 1700.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DEV: Export any Baan table to (proper) Excel Francesco Code & Utilities 27 2nd September 2011 14:00
Writing Export Conditions ian_j_albert Tools Development 4 22nd July 2010 07:30
Help regarding tools session rahul.kolhe22 Tools Development 4 22nd January 2010 13:31
problems with stpapi.zoom.option Finnigan AFS/DDC/OLE: Function servers 5 3rd November 2009 14:04
File Browser Bogdan Tools Development 52 7th January 2004 08:17


All times are GMT +2. The time now is 06:23.


©2001-2018 - Baanboard.com - Baanforums.com