TroisVerites Posted July 20, 2012 Share Posted July 20, 2012 Hi I know Freddy has a plan SCAR 4.00. But I would like to know if there is a solution with Record. When you define a function or procedure , how to access to the data ( NumVal , Values in the sample) ? I have plenty questions what I can do with Scar and what I can not do. Perhaps Freddy can tell me. What is the limitation about SCAR. Thanks Type Average = Record NumVal: Integer; Values: Array [1..200] of integer; Mean : function(): integer; { calculates the average value of the array } WriteLn : procedure (s: string); End; var Avg : Average; begin Avg.Mean(); Avg.WriteLn('tot'); end. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted July 20, 2012 Share Posted July 20, 2012 (edited) You can not do the procedures directly in a Record. But everything else works fine. Use @, at symbol to access data. Its just like in Delphi. SCAR does not support classes, or records with functions in them. However with the functions you can indirectly use them, but I don't think its worth messing with. But SCAR does have built in classes. An object is a variable of a class. Edited July 20, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted July 20, 2012 Author Share Posted July 20, 2012 HI Lord Can you show a sample ? with @ to acess data Thanks Quote Link to comment Share on other sites More sharing options...
FHannes Posted July 20, 2012 Share Posted July 20, 2012 HI Lord Can you show a sample ? with @ to acess data Thanks He means that you have to store the procedures in the record using the @ operator. AvgVariable.WriteLn := @WriteLn; for example There's no way to access the data in the record directly from a function pointer. Quote Link to comment Share on other sites More sharing options...