parames
13th March 2003, 10:17
Hello list,
In maintain sales order, for some reason , we used to key in the delivery place in the footer text (only for certain orders). ex:
DEL: SHIPMENT ON/ABT 06/03/03 *CHN
*CHN indicates that, this goods will be delivered to china..
so, how to recognise whether this "CHI" is exist in the footer text??
I don't know how to write the script for this.. Please help..
thanks,
Best Regards,
Parames.S
dbclark79
13th March 2003, 15:28
You will need to read the text into a string buffer using the function "text.to.buf" and then parse the buffer char by char until you hit an asterick "*".
Syntax
long text.to.buf( string text_field(17), string lang, long nr_lines, ref string buf(,) [, long rtf.text] )
Description
This stores the text of a specified text field in a two-dimensional string array.
Arguments
text_field The name of the text field that must be retrieved. See Text fields: overview.
lang This specifies the relevant language.
nr_lines This specifies the maximum number of lines that can be stored in the buffer.
buf This specifies the buffer in which the text must be stored.
rtf.text Set this argument to true if you want the text to be stored in RTF format instead of ASCII format. This is possible only when using a text group that supports RTF data.
Return values
>0 number of stored lines
0 error
- 1 no permission to store the text
© 1998 Baan Development B.V. All rights reserved
parames
14th March 2003, 03:16
Dear dbclark79,
Thanks for your reply..
But, could anyone give me example on how to use this function. I'm getting error and don't have any idea on how to use this 'text.to.buf' function.
Please help..
Thanks a lot
Regards,
Parames.s
NPRao
14th March 2003, 03:38
parames,
Can you post what kind of errors you are getting?
Refer to - text.to.buf() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_text_fields_text_to_buf)
you would have to add the statement -
#include<bic_text> in your program script in the declaration section.
parames
14th March 2003, 07:44
the problem is i don't know how to use this function
*******
select tdsls040.*
from tdsls040
where tdsls040._index1 = {:tdsls045.orno}
selectdo
temp.text = tdsls040.txtb
ch = text.to.buf(temp.text, "2",1, buf)
endselect
************
ch -- extern domain tcqiv1
temp.text -- extern domain tctxtn
buf -- extern domain tcrefa
and the error is
"Unresolved reference to function 'text.to.buf'"
I'm very new to this programming... so, really confused on how to use this function.. please help..
thanks and best regards,
Parames.s
zardoz
14th March 2003, 10:25
The unknown reference error is due this function isn't a std function, you have to put a
#include <bic_txt>
instruction in the declaration section.
parames
14th March 2003, 10:45
After i add it, i'm still getting the error messages :
ch = text.to.buf(Temp.text,"2",100,ref buf)
the error messeges are :
161 : Error : 'ref' not expected
161 : Error : Argument 1 for function 'text.to.buf' has illegal type.
161 : Error : Illegal type combination: 'long should be: string'
If i use this: (without ref)
ch = text.to.buf(Temp.text,"2",100, buf)
i get this error messeges:
161 : Warning 'buf' remains NOT FIXED in function 'text.to.buf'
161 : Error : Argument 4(buf) for function 'text.to.buf' should have 2 dimensions (not 1)
161 : Error : Argument 1 for function 'text.to.buf' has illegal type.
161 : Error : Illegal type combination: 'long should be: string'
Please help..
Best regards,
Parameswari Sellaparma
zardoz
14th March 2003, 11:00
The keyword ref is used only in the declaration part of the function, not in calling it.
Text.field is a string containing the field name of the text you want, by example: "tdsls040.txtb"
Lang could be the system constant language$ (the language of the user...
nr_lines is ok, but limiting... (at maximum I get 100 lines of text)
buf is a multidimentional string array, by example:
string buf(80, 100)
means 100 rows of 80 chars (to store the text)...
So the resulting calling could be:
.....
string buf(80, 100)
.....
.....
text.to.buf("tdsls040.txtb", language$, 100, buf)
.....