combine a field from a sub stack
Posted: Fri Sep 29, 2017 8:41 pm
It's been a many, many months since I've worked with livecode due to work etc. So i'm back to beginner status and i can't believe i have to ask this question.
Anyway, I'm trying to combine 2 fields with this save command. it's a knockoff of the notes app ( 8.0 +) where the highlited line of the notes list takes you to the individual note There is already text in both fields. They are both forms that when merged need additonal text/information added. The fields merege fine and i can add new text to the top of the combined field. When I add text to the second part (additonalInfo) of the COMBINED FORM, resave and then reopen them, the (additionalInfo)field from the substack is duplicated at the bottom of the form. Wouldn't the "else" statment know that the fields are alreay combided?
command saveNote
-- Declare any local variables
local tFilePath
-- Check that there is text in the note
put noteFilename() into tFilePath
if field "noteText" is not empty then
if fld "additionalInfo" of stack "refSub" is not in fld "noteText" then
put cr & fld "additionalInfo" of stack "refSub" after fld "noteText"
end if
else
end if
put fld "noteText" into url ("file:" & tFilePath)
end saveNote
using 8.1.3
Thanks,
Larry
Anyway, I'm trying to combine 2 fields with this save command. it's a knockoff of the notes app ( 8.0 +) where the highlited line of the notes list takes you to the individual note There is already text in both fields. They are both forms that when merged need additonal text/information added. The fields merege fine and i can add new text to the top of the combined field. When I add text to the second part (additonalInfo) of the COMBINED FORM, resave and then reopen them, the (additionalInfo)field from the substack is duplicated at the bottom of the form. Wouldn't the "else" statment know that the fields are alreay combided?
command saveNote
-- Declare any local variables
local tFilePath
-- Check that there is text in the note
put noteFilename() into tFilePath
if field "noteText" is not empty then
if fld "additionalInfo" of stack "refSub" is not in fld "noteText" then
put cr & fld "additionalInfo" of stack "refSub" after fld "noteText"
end if
else
end if
put fld "noteText" into url ("file:" & tFilePath)
end saveNote
using 8.1.3
Thanks,
Larry