ghostoftir
15th December 2011, 17:41
Hello,



I am trying to write a program to output from "tiitm001" in "tbase" to a flatfile.
My problem is that all fields retain their fixed length even if written to temporary fields. My output file is delimited but no matter what I do I cannot loose the trailing blanks from Items or Descriptions. The system that this new file will feed expects the trailing blanks to have been removed.
I tried various versions of passing a filed through "not.fixed(fieldname) but to no avail.
This is using the Baan Programming SQL taking data from tbase.

Any help would be gratefully received.


Regards


Jim

bdittmar
15th December 2011, 20:17
Hello,



I am trying to write a program to output from "tiitm001" in "tbase" to a flatfile.
My problem is that all fields retain their fixed length even if written to temporary fields. My output file is delimited but no matter what I do I cannot loose the trailing blanks from Items or Descriptions. The system that this new file will feed expects the trailing blanks to have been removed.
I tried various versions of passing a filed through "not.fixed(fieldname) but to no avail.
This is using the Baan Programming SQL taking data from tbase.

Any help would be gratefully received.


Regards


Jim

Hello,

use BaanERP Programmers Guide


strip$()

--------------------------------------------------------------------------------

Syntax
string strip$( string_expr )

Description
This returns a specified string without trailing spaces. The input string remains unchanged.

Context
Bshell function.

Example
strip$(" ABC ") | result " ABC"

in combination with :

BaanERP Programmers Guide


shiftc$(), shiftl$(), shiftr$()

--------------------------------------------------------------------------------

Syntax
string shiftc$( string strg(.) )
string shiftl$( string strg(.) )
string shiftr$( string strg(.) )

Description
These return the specified string with certain adjustments.

shiftc$() centers the string by equaling the number of leading and trailing spaces. If there is an odd number of spaces, the extra space becomes a trailing space. The returned string always has the same length as the input string.

shiftl$() removes any leading spaces from the input string.

shiftr$() moves the contents of the input string to the right, if there are trailing spaces. The length of the result is always the same as the length of the input string (this is not necessarily the declaration length).

Note
These functions do not change the input string.

Context
Bshell functions.

Example
shiftc$(" ABC ") | result " ABC "
shiftl$(" ABC ") | result "ABC "
shiftr$(" ABC ") | result " ABC"

So with strip$(shiftl$(fieldname)) you'll get a string without trailang and leading spaces.

Regards

ghostoftir
16th December 2011, 10:34
Thanks for your response. I will try this today and let you know:)

Mario
16th December 2011, 12:16
if your portingset on B4 is not to old you can use trim$(" ABC ") result = "ABC"
Regards,

ghostoftir
19th December 2011, 11:27
"bdittmar",


Thank You very much, your solution works well !!


Regards


Jim (ghostoftir)