More On My Substack Problems
Posted: Fri Oct 08, 2010 12:32 am
I think I may be out of luck but I am hoping for a clue. Here is the Summary of the "Find" command: "Searches the fields of the current stack", the operative word being "current".
Here is the single line (in many forms) I cannot get to work in a function call in one stack, when the function is called from a button in another application stack:
It always executes "find" in the application stack, not the library stack (sNames), even when I try to tell it which stack to use. If I add a field "fWords" to the application stack, it always works (all of the above lines act identically), but of course that is not where I want it to search. I cannot seem to be able to make "find" execute in the library stack, it insists on running in the defaultStack. Basically what I am finding is that "find" just ignores the "of" clause in every case, and without error. Unfortunately none of the other search functions will search through a named field in every card in a stack.
I am really trying to avoid having to do this on every function call, because it turned out to be inconsistent since some of my function calls call others, many of the functions have multiple exit points. and it adds a tremendous amount of code. It looks simple here, but in a complex function set it is unusable:
FYI, I am making sub stacks as pseudo-SQL tables during development and testing, that's why the data resides in the sub stacks. Only those that get to a certain size will transition to SQL, but they all have the same basic set of function calls.
I want to avoid the defaultStack complexities. My only other thought is going async (wait on a return event from the library stack) or brute force (repeat for each card, etc), but that's an entire new set of compexities.
Thoughts? Or are we all stuck with this? Thanks, Walt
Here is the single line (in many forms) I cannot get to work in a function call in one stack, when the function is called from a button in another application stack:
Code: Select all
find pBackName in fld "fWords"
find pBackName in fld "fWords" of the name of me
find pBackName in fld "fWords" of me
find pBackName in fld "fWords" of stack "sNames"
find pBackName in fld "fWords" of stack the short name of me
find pBackName in fld "fWords" of this stack
put "fWords of this stack" into tFieldName
find pBackName in fld tFieldName
put "field" && quote & "fWords" & quote && "of me" into tFieldName
find pBackName in tFieldName
I am really trying to avoid having to do this on every function call, because it turned out to be inconsistent since some of my function calls call others, many of the functions have multiple exit points. and it adds a tremendous amount of code. It looks simple here, but in a complex function set it is unusable:
Code: Select all
local tDefaultStackName
put the defaultStack into tDefaultStackName
set the defaultStack to "sNames"
find pBackName in fld "fWords"
if (someTestCondition) then
set the defaultStack to tDefaultStackName
return "Exited because of XXX"
end if
--call some other functions which also need to set defaultStack and also have multiple exit points
set the defaultStack to tDefaultStackName
return "Exited because of YYY"
...
I want to avoid the defaultStack complexities. My only other thought is going async (wait on a return event from the library stack) or brute force (repeat for each card, etc), but that's an entire new set of compexities.
Thoughts? Or are we all stuck with this? Thanks, Walt