I've included the whole command just for interest. Maybe there's something in there that'll give you a clue of what could be wrong.
Code: Select all
command buildFieldNameAndValuesVariable
global PLNListingDetailArray, gPLNColumnNames, gPLNFieldValues
local tArrayElement
local tValue, tCalculatedSeconds, tEnteredDate
local tItemName
repeat for each element tArrayElement in PLNListingDetailArray
put gPLNColumnNames & tArrayElement[3] & "," into gPLNColumnNames
put empty into tValue
switch tArrayElement[5]
case "OptionMenu" -- OptionMenu datatype
if tArrayElement[1] = "PropertyTypeOptionMenu" then
put the label of button "PropertyTypeOptionMenu" into tItemName
put char 1 of tItemName into tValue
break
end if
if tArrayElement[1] = "PropertySubtypeOptionMenu" then
put the label of button "PropertySubtypeOptionMenu" into tItemName
put char 1 of tItemName into tValue
break
end if
if tArrayElement[1] = "AreaOptionMenu" then
put the label of button "AreaOptionMenu" into tItemName
put char 1 of tItemName into tValue
break
end if
case "CheckBox" -- CheckBox datatype
if GetAction() = "Add" then
put 0 into tValue
end if
if tArrayElement[1] = "NoOpenHourCheck" then
if the hilite of button "NoOpenHourCheck" is true then
put 1 into tValue
end if
break
end if
if tArrayElement[1] = "IsRentalCheck" then
if the hilite of button "IsRentalCheck" is true then
put 1 into tValue
end if
break
end if
if tArrayElement[1] = "DontContactOwnerCheck" then
if the hilite of button "DontContactOwnerCheck" is true then
put 1 into tValue
end if
break
end if
case "DateEntryField"
put empty into tEnteredDate
if tArrayElement[1] = "ListDateField" then
put field "ListDateField" into tEnteredDate
--convert tEnteredDate from short date to seconds
convert tEnteredDate to seconds
put tEnteredDate into tValue
break
end if
if tArrayelement[1] = "ListingExpiryDateField" then
put field "ListingExpiryDateField" into tEnteredDate
--convert tEnteredDate from short date to seconds
convert tEnteredDate to seconds
put tEnteredDate into tValue
break
end if
if tArrayElement[1] = "OpenHourDateField" then
put field "OpenHourDateField" into tEnteredDate
convert tEnteredDate from short date to seconds
put tEnteredDate into tValue
break
end if
end switch
put gPLNFieldValues & tValue & "," into gPLNFieldValues
end repeat
delete last character of gPLNColumnNames
end buildFieldNameAndValuesVariable
Thx