Problem with colour assignment
Friends and experts,
I have this short piece of code (within function Fgr_BtnAssign) which I try to debug, because results are really odd:
// only either of these two is set (localised colour names)
sColour = wPalP.g0.pLine.g3.ddlColourStd.selection.text +
wPalP.g0.pLine.g3.ddlColourUser.selection.text;
alert ("«" + sColour + "» " + typeof sColour);
if (sColour = "") { return;} // mis-selection
//sColour = "Pale Green";
oColour = oDoc.GetNamedColor(sColour); // try to assign
alert ("«" + sColour + "»");
if (oColour.ObjectValid()) {
oObject.Color = oDoc.GetNamedColor(sColour);
} else {
msgText = "Can not set colour «" + sColour + "»";
}
Alert in line 04 says «Pale Green» string
Alert in line 08 says «» which is an empty string.
Hence GetNamedColor has destroyed it's argument what I have never seen before. Of course no colour is assigned and I get an error indication.
When directly assign a colour string in line 06, there is no problem...
ESTK mingled up? ➔ reboot ➔ nothing changed.
Well, it's time to perpare lunch anyway...
Klaus

