virtual height, parsing text and some bug
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
virtual height, parsing text and some bug
Hi and thanks for answering
(rev 2.9 on OSX)
question 1:
if I modify trought script the virtual height of the card, the minimum height of a resizable stack does not change according to it. I think it should because in this way the user gets a strange behaviour when he try to resize...
question 2:
is there a fast text parsing command ? (for example to take off extra spaces on a space delimited list). Now I am doing a repeat with word extraction...
Bug 1:
sometime a long script window keep scrolling by itself on mouse movements, as if I were keeping the mouse down on it (but I am not). It is rather annoying...
Bug 2:
On script debug mode, too often the breakpoints are ignored by Rev. The script stops only if you put them on place again before running the script.
Hope someone can tell me if these are real bugs or my faults..
Regards
Trevix
(rev 2.9 on OSX)
question 1:
if I modify trought script the virtual height of the card, the minimum height of a resizable stack does not change according to it. I think it should because in this way the user gets a strange behaviour when he try to resize...
question 2:
is there a fast text parsing command ? (for example to take off extra spaces on a space delimited list). Now I am doing a repeat with word extraction...
Bug 1:
sometime a long script window keep scrolling by itself on mouse movements, as if I were keeping the mouse down on it (but I am not). It is rather annoying...
Bug 2:
On script debug mode, too often the breakpoints are ignored by Rev. The script stops only if you put them on place again before running the script.
Hope someone can tell me if these are real bugs or my faults..
Regards
Trevix
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: virtual height, parsing text and some bug
I'm not sure I understand. Could I trouble you to elaborate?trevix wrote:Hi and thanks for answering
(rev 2.9 on OSX)
question 1:
if I modify trought script the virtual height of the card, the minimum height of a resizable stack does not change according to it. I think it should because in this way the user gets a strange behaviour when he try to resize...
To trim the leading and trailing spaces from a string you can use a function like this:question 2:
is there a fast text parsing command ? (for example to take off extra spaces on a space delimited list). Now I am doing a repeat with word extraction...
function TrimSpaces s
return word 1 to (the number of words of s) of s
end TrimSpaces
[quote[Bug 1:
sometime a long script window keep scrolling by itself on mouse movements, as if I were keeping the mouse down on it (but I am not). It is rather annoying...
Bug 2:
On script debug mode, too often the breakpoints are ignored by Rev. The script stops only if you put them on place again before running the script.[/quote]I believe both are known bugs, but I haven't looked into the Rev Qualitty Control Center to verify. You can search the RQCC at:
http://quality.runrev.com/qacenter/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
virtual height, parsing text and some bug
Question 1:
I have a resizable stack (both handling a "resizeStack" script and with automatic geometry) where, at the bottom, there is a fld that I want to show or hide having the heigth added to the stack changed.
I thought it was convenient to just change the Virtual height of the card : (hide)
(show)
Of course I also have a minimum height for the stack, so that it does not get too small
Example:
The min height is 574
The virtual height of the card (cREVGeneral["virtualHeight"] is 35, hiding the fld) (by the way...height and width on Inspector are mixed up).
The height of the stack is 574
Then..I want to show the fld (add 0 to cREVGeneral["virtualHeight"])
The height of the stack becomes 609
If the user try then to reduce the height of the stack and then I add again 35 to virtual height (hiding the fld), the stack will be 539, smaller then the min height.
Hard to explain. The point is that I think the min height should keep trace of the added virtual height
question 2:
is there a way to parse also spaces in between (so that there is only 1 space between words) ?
Thanks for your time
Trevix
I have a resizable stack (both handling a "resizeStack" script and with automatic geometry) where, at the bottom, there is a fld that I want to show or hide having the heigth added to the stack changed.
I thought it was convenient to just change the Virtual height of the card :
Code: Select all
set the cREVGeneral["virtualHeight"] of card 1 of stack "X" to 35
Code: Select all
set the cREVGeneral["virtualHeight"] of card 1 of stack "X" to 0
Of course I also have a minimum height for the stack, so that it does not get too small
Example:
The min height is 574
The virtual height of the card (cREVGeneral["virtualHeight"] is 35, hiding the fld) (by the way...height and width on Inspector are mixed up).
The height of the stack is 574
Then..I want to show the fld (add 0 to cREVGeneral["virtualHeight"])
The height of the stack becomes 609
If the user try then to reduce the height of the stack and then I add again 35 to virtual height (hiding the fld), the stack will be 539, smaller then the min height.
Hard to explain. The point is that I think the min height should keep trace of the added virtual height
question 2:
is there a way to parse also spaces in between (so that there is only 1 space between words) ?
Thanks for your time
Trevix
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
I'm unfamiliar with the concept of "virtualHeight", and have not delved into Rev's properties deeply enough to guess what it may do with such a thing.
What's the goal you want to achieve with that?
As for spaces, there are a couple ways to do that - here's one:
function TrimExtraSpaces s
put empty into tReturnVal
repeat for each word tWord in s
put tWord &space after tReturnVal
end repeat
delete last char of tReturnVal -- trailing space
return tReturnVal
end TrimExtraSpaces
What's the goal you want to achieve with that?
As for spaces, there are a couple ways to do that - here's one:
function TrimExtraSpaces s
put empty into tReturnVal
repeat for each word tWord in s
put tWord &space after tReturnVal
end repeat
delete last char of tReturnVal -- trailing space
return tReturnVal
end TrimExtraSpaces
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
As for the extraSpaceTrimming, you solution is what I was already using. I just tough that there was a parsing command that i could not find...[/quote]
There might be some clever one-liner possible with regex, but it benchmarks so much slower than parsing with Transcript chunk expressions that I rarely bother with it.
There might be some clever one-liner possible with regex, but it benchmarks so much slower than parsing with Transcript chunk expressions that I rarely bother with it.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Trevix,
Q1: I don't agree: such dependencies will give you a hard time fixing things when you make tiny mistakes. Set the card size to an incorrect value, set it back and you'll have to reset stack height, background heights, object heights, etc.
Q2: "the repeat for" structure appears to be faster than doing all the stuff at once using an array, for example (see a recent discussion about sorting on the mail list).
B1: Yes, I agree, that's terrible, but I have never been able to reproduce this problem consistently. Can you?
B2: I think breakpoints are ignored if they are in front of a comment, an empty line, or a line that starts with "end". I have also noticed that breakpoints are sometimes ignored for no obvious reason.
Best,
Mark
Q1: I don't agree: such dependencies will give you a hard time fixing things when you make tiny mistakes. Set the card size to an incorrect value, set it back and you'll have to reset stack height, background heights, object heights, etc.
Q2: "the repeat for" structure appears to be faster than doing all the stuff at once using an array, for example (see a recent discussion about sorting on the mail list).
B1: Yes, I agree, that's terrible, but I have never been able to reproduce this problem consistently. Can you?
B2: I think breakpoints are ignored if they are in front of a comment, an empty line, or a line that starts with "end". I have also noticed that breakpoints are sometimes ignored for no obvious reason.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Mark,
Q1
from the docs:
"Use this option to implement a layout that allows a section of
optional controls to be folded out."
You may be right but it seems to me that using the cREVGeneral["virtualHeight"], to hide and show section , the minimum height should be taken care by Revolution accordingly.
In my case I had to write a "set the min height to..." to temporary change the value so that the stack does not jump up and down when the user resize.
Trevix
Q1
from the docs:
"Use this option to implement a layout that allows a section of
optional controls to be folded out."
You may be right but it seems to me that using the cREVGeneral["virtualHeight"], to hide and show section , the minimum height should be taken care by Revolution accordingly.
In my case I had to write a "set the min height to..." to temporary change the value so that the stack does not jump up and down when the user resize.
Trevix