*a commandbutton click .MsgNoteText = recordtostring() function RecordToString ...Is not legal and causes the error you mentioned. OTOH this is legal :
*RecordToString.prg as a separate external file *code ... && Remember first line doesn't have a 'Function ...' here * Otherwise a call would return immediately with .T. * Because an implicit 'return .T.' is applied as a line * starting with 'Function' or 'Procedure' encountered myText = TypeConvert(myValue) return myText function TypeConvert && A prg could have multiple functions and/or classes in it lparameters luValue *code... return SomeString * Other function and procedures if any.. *Classes after procs and funcs if any.. *a commandbutton click .MsgNoteText = recordtostring() && Here calls external recordtostring.prgCetin