Page 2 of 2
Re: Quoting between substacks
Posted: Fri Mar 22, 2019 3:20 pm
by bwmilby
Someone wanting to prove that the engine can handle it. Not really useful in general. One use case to allowing it from disk would be allowing someone to open two “Untitled 1” stacks and rename them without having to jump through hoops.
Re: Quoting between substacks
Posted: Fri Mar 22, 2019 3:25 pm
by Klaus
Hi Brian,
bwmilby wrote: Fri Mar 22, 2019 3:20 pmSomeone wanting to prove that the engine can handle it.
that must be Richard G. then!
Best
Klaus
Re: Quoting between substacks
Posted: Fri Mar 22, 2019 4:28 pm
by bogs
Klaus wrote: Fri Mar 22, 2019 3:16 pm
Who would want so?

Re: Quoting between substacks
Posted: Fri Mar 22, 2019 4:31 pm
by Klaus
bogs wrote: Fri Mar 22, 2019 4:28 pm
Klaus wrote: Fri Mar 22, 2019 3:16 pm
Who would want so?
Except the usual suspects I meant...

Re: Quoting between substacks
Posted: Fri Mar 22, 2019 8:45 pm
by FourthWorld
[-hh] wrote: Fri Mar 22, 2019 2:07 pm
FourthWorld wrote:You can set any property of any object in any stack, even if it's not been explicitly opened.
You didn't try. Did you?
Do you imagine I took the time to post the steps above merely randomly?
Did
you try it?
Make a new stack (="Untitled 1") with one field and save it as </path/to/file/a.livecode>.
Then restart LC and make a new stack (="Untitled 1") with a button. Button's script:
Code: Select all
on mouseUp
put 1 into fld 1 of card 1 of stack </path/to/file/a.livecode>
end mouseUp
... Your rule doesn't apply for that scenario here.
True, when dealing with the well-known stack name conflicts introduced by the IDE, it's possible to come up with an edge case that doesn't work. Similarly, the computer must be turned on. And the computer must have a functioning file system installed. We could probably come up with a long list of edge cases if we choose to spend our time that way. I have a habit of focusing on practical solutions, which puts me at a disadvantage in such pursuits. I generally don't choose stack names that I don't want.
If you work on a team that puts stacks into production with the name "Untitled 1" there are bigger challenges than needing to change properties in separate stack files without triggering the open* messages.

Re: Quoting between substacks
Posted: Thu Mar 28, 2019 7:50 pm
by kresten
Thank you for clarifications.
I have now tried and experimented without succes.
Briefly: 2 substacks:
a) "Phenomenalog", accumulating daycards, with textfield, for users diary notes
b) "Parsings" with two fields : i) "searching" & ii) "occurrences"
The handler "phenoparse" is placed in the script of stack "Phenomenalog".
It shall permit user to specify a search-term and perform an automatic scanning the texts of all daycards & quote all lines where the specified word(s) /name/number appears.
I attach the script of the handler in the hope that someone can suggest how to repair it.
------------------
on phenoparse
global phenodate,cue,start,hitcard
ask "Which word shall be searched?"
if it is empty then
exit phenoparse
else
put it into cue
end if
ask "How many lines before ?" with "0"
if it is cancel then
exit phenoparse
end if
put it into avant
ask "How many lines after ?" with "0"
if it is cancel then
exit phenoparse
end if
put it into apres
open stack "Parsings"
new card
open field "searchings"
put "Parsed for" && cue && phenodate after field "searchings"of stack "Parsings"
go first card of stack "Phenomenalog"
find string cue in field "TextField"
if the result is "not found" then
answer "cannot find this word"
exit phenoparse
else
put short name of this card && the foundchunk into start
put short name of this card into hitcard
-- open field “occurrences” of stack "Parsings"
put "<p>" & start & hitcard &"</p>" into field “occurrences” of last card of stack "Parsings"
put "<p>" & short name of this card & "</p>" into field “occurrences” of last card of stack "Parsings"
-- put the htmltext of line (word 2 of the foundline) - avant to (word 2 of the foundline) + apres of field "Textfield" after field “occurrences” of stack "Parsings"
-- put string cue after field “occurrences”
end if
repeat
set cursor to busy
find string cue in field "TextField"
if short name of this card && the foundchunk is start then
exit repeat
end if
if short name of this card is not hitcard then
put short name of this card into hitcard
put "<p> ----------------------</p>" after field “occurrences” of stack “Parsings”
put "<p>" & short name of this card & "</p>" after field “occurrences” of stack “Parsings”
end if
put the htmltext of line (word 2 of the foundline) - avant to (word 2 of the foundline) + apres of field "Textfield" after field “occurrences” of stack “Parsings”
end repeat
go last card
put return & phenodate && the time && "Parsed:" && cue after field "TextField"
show stack "Parsings"
end phenoparse
Re: Quoting between substacks
Posted: Thu Mar 28, 2019 11:34 pm
by dunbarx
Hi,
Please, please frame code offerings within the code tags (</>). It makes it much easier to see what is going on.
I glanced at your handler. Is this correct?
Code: Select all
if short name of this card && the foundchunk is start then
See the line properly "tagged"? And does this make sense?
Craig