Re: [fpc-pascal] Selecting Records with a variable

2020-12-19 Thread Jean SUZINEAU via fpc-pascal
I know you don't like objects, but maybe something like : unit uAxisRecord; {$mode objfpc}{$H+} interface uses  Classes, SysUtils; type  { TAxisRecord }  TAxisRecord  =   object     X,Y,Z,A,B,C: Double;     function Value_from_Letter(

Re: [fpc-pascal] Selecting Records with a variable

2020-12-19 Thread James Richters via fpc-pascal
No, this is just a simplified example.. The procedure will be working with dozens of records, so I need a way to call the procedure and specify which element of all the records to use... it will not be called for every element. James -Original Message- From: fpc-pascal On Behalf Of

Re: [fpc-pascal] Selecting Records with a variable

2020-12-19 Thread wkitty42--- via fpc-pascal
On 12/19/20 7:16 PM, James Richters via fpc-pascal wrote: Is there some syntax that would work to select the correct record based on the variable so I can avoid having all the If statements? do you need to show only one at a time or are you looping through and printing all of them each time?

[fpc-pascal] Selecting Records with a variable

2020-12-19 Thread James Richters via fpc-pascal
The best way to explain what I'm hoping to do is by example... Say I have this record: Type Axis_Record = Record X,Y,Z,A,B,C: Double; End; Var AxisValue : Axis_Record; Instead of this: Procedure ShowAxis(Axisletter:Char); Begin If AxisLetter = 'X' Then Writeln(AxisValue.X);

Re: [fpc-pascal] callback from c with varargs

2020-12-19 Thread Jonas Maebe via fpc-pascal
On 19/12/2020 22:35, Luca Olivetti via fpc-pascal wrote: > I'm trying to use a c library where I can define a logging plugin. > > The c prototype for the callback is > >     void (*log)(void *logContext, UA_LogLevel level, UA_LogCategory > category, const char *msg, va_list args); > > >

[fpc-pascal] callback from c with varargs

2020-12-19 Thread Luca Olivetti via fpc-pascal
Hello, I'm trying to use a c library where I can define a logging plugin. The c prototype for the callback is void (*log)(void *logContext, UA_LogLevel level, UA_LogCategory category, const char *msg, va_list args); however I couldn't find a way to define a suitable callback in fpc

[fpc-pascal] TurboVision is reborn as FOSS (again)

2020-12-19 Thread Liam Proven via fpc-pascal
https://github.com/magiblot/tvision Someone enterprising could make a TurboPascal clone out of FPC. :-) -- Liam Proven – Profile: https://about.me/liamproven Email: lpro...@cix.co.uk – gMail/gTalk/gHangouts: lpro...@gmail.com Twitter/Facebook/LinkedIn/Flickr: lproven – Skype: liamproven UK: +44