It would probably take about the same amount of time if you start the timer before the first two lines that empty the fields. Or did you try that?dunbarx wrote: The process runs 30% SLOWER if I do not empty the fields. I only did that for feedback. It actually takes a little time to empty them. I get about 315 ticks if I empty, and 400 if I do not
How to read from a file every 3 lines until eof
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: How to read from a file every 3 lines until eof
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: How to read from a file every 3 lines until eof
Hi jacque, its really amazing; the process that took about 3 mins now just completed within 10 secs for taking the result into a variable. Special Thanks to you and Craig for the amazing trick. Btw, can you tell me is it possible to scroll 2 fields at the same time? I mean if I scroll field 1, it will auto scroll field 2 too. Thanks
Re: How to read from a file every 3 lines until eof
How bout showing a loading animation while livecode procceses the data? Even tho it dosent show the exact percentage of the progress, atleast the user knows that he has to wait.
You can find some here: http://preloaders.net/en/circular
As for the scrollBars i guess you could do something like that:
field 1 code:
field 2 code:
You can find some here: http://preloaders.net/en/circular
As for the scrollBars i guess you could do something like that:
field 1 code:
Code: Select all
on scrollbardrag
set the thumbPosition of fld 1 to the thumbPosition of me
end scrollbardrag
Code: Select all
on scrollbardrag
set the thumbPosition of fld 2 to the thumbPosition of me
end scrollbardrag
Knowledge is meant to be shared.
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: How to read from a file every 3 lines until eof
thanks zaxos; I've corrected your script to the working one
Code: Select all
on scrollbarDrag
set the vScroll of fld "f2" to the vScroll of me
end scrollbarDrag
Re: How to read from a file every 3 lines until eof
Code: Select all
on scrollbarDrag
set the vScroll of fld "f2" to the vScroll of me
end scrollbarDrag

-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: How to read from a file every 3 lines until eof
Klaus wrote:Yep, now THAT makes senseCode: Select all
on scrollbarDrag set the vScroll of fld "f2" to the vScroll of me end scrollbarDrag



hi Klaus, I have a Menubar which has a background color (check my snapshot) although I've checked in its Property Inspector there's no background color set. Is it possible to remove that background color?
- Attachments
-
- Untitled.png (717 Bytes) Viewed 7896 times
Re: How to read from a file every 3 lines until eof
If you do not explicitely set a property, it gets inherited from the object higher in hierarchie like this:
button -> group -> card -> stack
So the best way in your case is to uncheck the OPAQUE property for your buttons!
button -> group -> card -> stack
So the best way in your case is to uncheck the OPAQUE property for your buttons!

-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: How to read from a file every 3 lines until eof
I've edited the menu group and uncheck "Opaque" option for both buttons; but still it's showing the background 

Re: How to read from a file every 3 lines until eof
Then you see the color of the object(s) BEHIND your buttons!
Set a backcolor for your buttons so they look like they have NO color set, know what I mean?

Set a backcolor for your buttons so they look like they have NO color set, know what I mean?
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: How to read from a file every 3 lines until eof
I've already tried that before; but it's not effective though. Then I've removed the menubar built by "Menu Builder"; and created a new pulldown menu which has no background color and perfect as I expected. The problem goes with the "Menubar Builder" menu. But Klaus, I'm always thankful for your tricky replies 

Re: How to read from a file every 3 lines until eof
Menu builder creates a transparent menu group. You can make it opaque and stretch it to fit the width of your stack, and then set its color to anything you want. Then I usually make all the menu buttons transparent.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: How to read from a file every 3 lines until eof
[quote="alemrantareq"]Hi jacque, its really amazing; the process that took about 3 mins now just completed within 10 secs for taking the result into a variable. Special Thanks to you and Craig for the amazing trick./quote]
Quoting all literals, like object names, is another way to speed up scripts. The effects aren't as dramatic as using variables instead of fields, but in repeat loops the differences are noticeable. Always quote literals.
Quoting all literals, like object names, is another way to speed up scripts. The effects aren't as dramatic as using variables instead of fields, but in repeat loops the differences are noticeable. Always quote literals.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: How to read from a file every 3 lines until eof
hello, now I'm stuck again. I have 2 columns:
Col 1 (sample)
sjjwjas
dwaiask
dlawla
hylallu
Col 2 (sample)
31316
63676
97761
41731
I want to combine then together. So the expected return will be:
sjjwjas-31316
dwaiask-63676
dlawla-97761
hylallu-41731
Is that possible by repeat loop process? thanks...
Col 1 (sample)
sjjwjas
dwaiask
dlawla
hylallu
Col 2 (sample)
31316
63676
97761
41731
I want to combine then together. So the expected return will be:
sjjwjas-31316
dwaiask-63676
dlawla-97761
hylallu-41731
Is that possible by repeat loop process? thanks...
Re: How to read from a file every 3 lines until eof
HI.
See any traps with this?
And you are working on the basics of LC while all this is going on, right?
Craig
Code: Select all
repeat with y = 1 to the number of lines of fld "sample1"
put line y of fld "sample1" & "-" & line y of fld "sample2" into line y of temp
end repeat
put temp into fld "combinedData"
And you are working on the basics of LC while all this is going on, right?
Craig