hiCreateMLTextField only shows one line at a time

D

David

Guest
I am trying to use a MLText device to show the status of the program
as it proceeds through its flow but only one line shows and gets
overwritten rather than creating a newline.
If I type into the device from the keyboard, it behaves as expected.
As soon as the program writes to it, all the previous data is
replaced by a single line. I was hoping to eventually use this
to display running results from an external program.

This is the device: ***********************************************
startList =
append( startList
list(
list( hiCreateMLTextField(
?name 'startMLText1
;;;?prompt "Messages"
?value ""
?defValue ""
;;;[?font t_font]
?hasVerticalScrollbar t
?hasHorizontalScrollbar t
?enableWordWrap t
?editable t
?enabled t
;;;[?callback t_callback]
;;;[?changeCB t_changeCB]
;;;[?nextField g_nextField]
) startXOS-90:423 462:100 50
)
) ;;; end list list
) ;;; end append

This is a call to it : ***********************************************

if( isDir( plotDir ) == nil
then
printStartMsg( sprintf(nil, "Creating %s \n", plotDir
) )
createDir( plotDir )
else
printStartMsg( sprintf(nil, "%s already created \n",
plotDir ) )
) ;;; end if isDir

This the routine to write it :
***********************************************

procedure(
printStartMsg( str1 ) (

prog ( msg )

oldValue = BP_StartForm->startMLText1->lastValue
msg = concat( str1 oldValue )
BP_StartForm->startMLText1->value = msg

) ;;; end printStartMsg
) ;;; end procedure

Any help with this?

David
 
David,
I modified the code. Check if this is what you want.

If the message size goes large, I suggest you go for appending a unix
file and opening it in the cadence file viewer with autoUpdate ON.

;This is the device: ***********************************************
startMLText1 = list( hiCreateMLTextField(
?name 'startMLText1
;;;?prompt "Messages"
?value ""
?defValue ""
;;;[?font t_font]
?hasVerticalScrollbar t
?hasHorizontalScrollbar t
?enableWordWrap t
?editable t
?enabled t
;;;[?callback t_callback]
;;;[?changeCB t_changeCB]
;;;[?nextField g_nextField]
) 5:5 462:100 50
)

;This is a call to it : ***********************************************

if( isDir( "/tmp/tmp" ) == nil
then
printStartMsg( sprintf(nil, "Creating %s \n", "/tmp/tmp") )
createDir( "/tmp/tmp" )
else
printStartMsg( sprintf(nil, "%s already created \n",
"/tmp/tmp" ) )
) ;;; end if isDir

;This the routine to write it :
;***********************************************

procedure( printStartMsg(str1)
prog(
(
msg
)

oldValue = BP_StartForm->startMLText1->value
msg = sprintf(nil, "%s\n%s" oldValue str1)
BP_StartForm->startMLText1->value = msg
);prog
);procedure

BP_StartForm = hiCreateAppForm(
?name 'BP_StartForm
?fields list(
startMLText1
)
)

hiDisplayForm(BP_StartForm)



;************************************************************************************************




David wrote:
I am trying to use a MLText device to show the status of the program
as it proceeds through its flow but only one line shows and gets
overwritten rather than creating a newline.
If I type into the device from the keyboard, it behaves as expected.
As soon as the program writes to it, all the previous data is
replaced by a single line. I was hoping to eventually use this
to display running results from an external program.
Code:
Any help with this?

David[/QUOTE]
 
Thank you, Suresh!!
This solution works very well :)
David

suresh j <sureshjeeva00@yahoo.com> wrote in message news:<3FBDA769.2050302@yahoo.com>...
David,
I modified the code. Check if this is what you want.

If the message size goes large, I suggest you go for appending a unix
file and opening it in the cadence file viewer with autoUpdate ON.

;This is the device: ***********************************************
startMLText1 = list( hiCreateMLTextField(
?name 'startMLText1
;;;?prompt "Messages"
?value ""
?defValue ""
;;;[?font t_font]
?hasVerticalScrollbar t
?hasHorizontalScrollbar t
?enableWordWrap t
?editable t
?enabled t
;;;[?callback t_callback]
;;;[?changeCB t_changeCB]
;;;[?nextField g_nextField]
) 5:5 462:100 50
)

;This is a call to it : ***********************************************

if( isDir( "/tmp/tmp" ) == nil
then
printStartMsg( sprintf(nil, "Creating %s \n", "/tmp/tmp") )
createDir( "/tmp/tmp" )
else
printStartMsg( sprintf(nil, "%s already created \n",
"/tmp/tmp" ) )
) ;;; end if isDir

;This the routine to write it :
;***********************************************

procedure( printStartMsg(str1)
prog(
(
msg
)

oldValue = BP_StartForm->startMLText1->value
msg = sprintf(nil, "%s\n%s" oldValue str1)
BP_StartForm->startMLText1->value = msg
);prog
);procedure

BP_StartForm = hiCreateAppForm(
?name 'BP_StartForm
?fields list(
startMLText1
)
)

hiDisplayForm(BP_StartForm)



;************************************************************************************************




David wrote:
I am trying to use a MLText device to show the status of the program
as it proceeds through its flow but only one line shows and gets
overwritten rather than creating a newline.
If I type into the device from the keyboard, it behaves as expected.
As soon as the program writes to it, all the previous data is
replaced by a single line. I was hoping to eventually use this
to display running results from an external program.
Code:
Any help with this?

David[/QUOTE]
 

Welcome to EDABoard.com

Sponsor

Back
Top