macahu
14th March 2006, 16:21
Hi,
is there a way to display a text field from table as a message (a pop up), like :
attr.message$ = form.text$("tccom100.tex1") ???
Thanks for your help
NPRao
14th March 2006, 21:36
Here is an example -
long nr_lines
string buffer(100, 240), result(1) based
e = switch.to.company(100)
select zmmig200.*
from zmmig200
order by zmmig200._index1
selectdo
nr_lines = text.to.buf("zmmig200.note", "2", 240, buffer)
convert.array.2dto1d(buffer, result, "")
if nr_lines > 0 then
message("Text-%s", result)
endif
endselect
convert.array.2dto1d() is a function in my library, which takes a single two dimensional array of string with a separater (,) and converts into a single dimensional array.
macahu
16th March 2006, 09:40
Thanks a lot Rao for your response. i'm interested by your library if you can send it to me.
I find another way :
string texte(80)
texte = str$(field table)
message(field table) without ""
best regards
NPRao
16th March 2006, 20:41
macahu,
I changed my code to match with yours and it gives me compilation error.
string temp(1024)
nr_lines = text.to.buf("zmmig200.note", "2", 240, buffer)
convert.array.2dto1d(buffer, result, "")
if nr_lines > 0 then
message("Text-%s", result)
temp = str$(zmmig200.note)
message(zmmig200.note)
endif
pzmadmtest0( 152): Error: Argument 1 for function 'message' has illegal type.
pzmadmtest0( 152): Error: Illegal type combination: 'long should be: string'
Please post your solution on board for other's benefit. Sorry, I cannot send you source codes from our system.
macahu
20th March 2006, 09:49
HI,
Here is the code :
string texte(80)
select zmmig200.*
from zmmig200
order by zmmig200._index1
selectdo
texte = str$(zmmig200.note)
message(texte)
endselect
and the field zmmig200.note has a tcmcs.str80 domain in table zmmig200
Best regards
NPRao
20th March 2006, 18:20
Ok, I see the issue. zmmig200.note is actually a text field and has the domain tctxtn. If you are using a table field which is string you don't have to reconvert it to a string using str() and just use it as - message("%s", zmmig200.strnote)