Appending Data to a scrolling field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bmcgonag
Posts: 40
Joined: Thu Mar 13, 2014 6:51 pm

Appending Data to a scrolling field

Post by bmcgonag » Thu Mar 20, 2014 5:24 pm

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.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Appending Data to a scrolling field

Post by Klaus » Thu Mar 20, 2014 5:44 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Appending Data to a scrolling field

Post by dunbarx » Thu Mar 20, 2014 5:46 pm

AH.

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

Craig Newman

bmcgonag
Posts: 40
Joined: Thu Mar 13, 2014 6:51 pm

Re: Appending Data to a scrolling field

Post by bmcgonag » Thu Mar 20, 2014 5:55 pm

As always, you guys Rock! Thanks so much!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Appending Data to a scrolling field

Post by Klaus » Thu Mar 20, 2014 7:00 pm

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

Post Reply