Page 1 of 1

Appending Data to a scrolling field

Posted: Thu Mar 20, 2014 5:24 pm
by bmcgonag
I have a field where my user will type in information, and based on what they type, the information and mor info will be added to a scrolling field.

I have the information I want to be entered going into the scrolling field, but it keeps deleting what was there prior.

I had it working to some extent, but in creating a handler to deal with repeated operations, it now deletes the previously entered information, and replaces it.

Code: Select all

 
on procHelpLs  
   put "ls - lists all files and folders in a direcotry." into dataOutput
   generateHelpTimers dataOutput
end procHelpLs

on generateHelpTimers helpText
   get field "dataOutputField"
   put cr & helpText & cr into it
   wait 170 milliseconds with messages
   put it into field "dataOutputField"
end generateHelpTimers
The simple snippet above shows what I'm doing, but in the procHelpLs handler I actually pass several different lines of text through dataOutput a few times so that the information is placed into the field "dataOutputField" more like a terminal emulation.

Right now, with the code above, it keeps replacing the previous text. So at the end, the only line of text in "dataOutputField" is the last line sent.

Any help is greatly appreciated.

Re: Appending Data to a scrolling field

Posted: Thu Mar 20, 2014 5:44 pm
by Klaus
Hi bmcgonag,

you can always do this:
...
put CR & aStringVariable & CR AFTER fld "the scrolling one"
...

Maybe that is what you are looking for?

A general hint:
Only use IT once (or avoid completely), since it might change when you least exspect IT :D

Code: Select all

on generateHelpTimers helpText
   put field "dataOutputField" into aVariable
   put cr & helpText & CR AFTER aVariable
   wait 170 milliseconds with messages
   put aVariable into field "dataOutputField"
end generateHelpTimers
Look ma, no IT :D

That was just an example, better use this:

Code: Select all

on generateHelpTimers helpText
    wait 170 milliseconds with messages
    put cr & helpText & CR AFTER field "dataOutputField"
end generateHelpTimers
Best

Klaus

Re: Appending Data to a scrolling field

Posted: Thu Mar 20, 2014 5:46 pm
by dunbarx
AH.

Please look up the "after" keyword in the dictionary. Then think about "before". You already know how "into" works.

Craig Newman

Re: Appending Data to a scrolling field

Posted: Thu Mar 20, 2014 5:55 pm
by bmcgonag
As always, you guys Rock! Thanks so much!

Re: Appending Data to a scrolling field

Posted: Thu Mar 20, 2014 7:00 pm
by Klaus
Hi bmcgonag,
bmcgonag wrote:As always, you guys Rock!
well, I actually do:
https://www.youtube.com/watch?v=jQoKiWKjPUc

My old band (RIP), I'm the guy with the bass 8)


Best

Klaus