CLEAR SET MEMOWIDTH TO 150 CREATE CURSOR myCursor ( myField M) INSERT INTO myCursor VALUES (REPLICATE('?',101)) SCATTER MEMO NAME myRecord INSERT INTO myCursor VALUES (PADR('My name is Fabio',101,'-')) SCATTER MEMO MEMVAR myRecord.myField = m.myField +'I add this' ? 'Property' ? '*********************************' ? 'Expected =', myCursor.myField +'I add this' AT 20 ? 'Effective =', myRecord.myField AT 20 ? ? ? 'Variable' ? '*********************************' ? 'Expected =', myCursor.myField AT 20 ? 'Effective =', m.myField AT 20This is a repro code with comments:
* YOU CAN CHANGE THESE CONSTANTS #define PROPERTYNAME someName #define SUFFIXSTRING null CLEAR oSome=CREATEOBJECT("Empty") WITH m.oSome ADDPROPERTY(m.oSome,[someName],NULL) FOR N=1 TO 50 * Set the property to some variant value randomSet = RAND() DO CASE CASE m.randomSet < 0.2 && A NULL .propertyName = .NULL. CASE m.randomSet < 0.3 && A LOGICAL .propertyName = RAND()<0.5 CASE m.randomSet < 0.5 && A NUMBER .propertyName = RAND() CASE m.randomSet < 0.6 && A CURRENCY .propertyName = NTOM(RAND()*1000000) CASE m.randomSet < 0.7 && A DATETIME .propertyName = DATETIME() OTHERWISE .propertyName = REPLICATE(CHR(RAND()*256),RAND()*10) ENDCASE * save it propertyPush = .propertyName * Now: build a variable WITH THESE CONDITIONS: * - the variable's name is equal to the property's name * - fill this variable with a string propertyName = REPLICATE(CHR(RAND()*256),RAND()*200) * Now, copy the variable into the property, but add a suffix string ( it can to be empty or null ), * with this copy command: * -------------------- * <someobjectreference>.<propertyName> = !m.!<propertyName> !+! SUFFIXSTRING * -------------------- * IF LEN(m.propertyName) IS UPPER TO 100, * THEN THE COPY HAVE NOT EFFECT, AND THE PROPERTY VALUE STILL UNCHANGED ! * IF the added string have LEN(SUFFIXSTRING) upper to zero, VFP put the result value into the source variable ! * This is correlate with the VFP's "Variable string add optimization alghoritm" * !m.! and !+! they are important for the apparition of the bug * ######### BUG LINE ################# .propertyName = m.propertyName + SUFFIXSTRING * ######### BUG LINE ################# ********** with these commands the bug it is not appear * <someobjectreference>.propertyName = m.propertyName * <someobjectreference>.propertyName = propertyName + SUFFIXSTRING * <someobjectreference>.propertyName = '' + m.propertyName + SUFFIXSTRING * STORE m.propertyName + SUFFIXSTRING TO this.propertyName IF VARTYPE(.propertyName,.T.)==VARTYPE(m.propertyPush,.T.) AND .propertyName == m.propertyPush ? 'property is unchanged',' type :', VARTYPE (.propertyName),' variable lenght :',LEN(m.propertyName) ?? ' variable is changed to ',m.propertyName ENDIF NEXT ENDWITH ? ">>>>>>>>>> Expected this text line to be printed, only"Notes: