Jump to content

Search the Community

Showing results for tags 'record'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 4 results

  1. Hello, When overloading operators in a Delphi record, it is possible to specify a result type that the documentation does not recognize: TCondRec = record public Text: string; Params: TParams; class operator LogicalAnd (aLeft, aRight: TCondRec): TCondRec; // return TCondRec instead of Boolean class operator LogicalOr (aLeft, aRight: TCondRec): TCondRec; // here as well This allows us to write expressions such as the below, to generate an SQL string as the result of joining `aLeft` and `aRight` with an `AND` or `OR` operator. It seems this technique is internally used by EntityDAC components in order to provide an "SQL Builder", somewhat similar to the idea exposed here. My worry however, is that this syntax showed above is not documented: according to the Embarcadero docs, these class operators are supposed to return a Boolean. Here's some screenshots of what can be done: The question is: How concerned should I be about using such a library, in the eventuality that Embarcadero decides to enforce the syntax described by its documentation? Or alternatively (if lucky), any chance the documentation itself is wrong? (docs are often known to be missing, maybe they just didn't write it correctly here?) Thanks
  2. Hi, I have 1000+ records. This records contains pointer types. When records streamed on Win32 /Win64 has a different sizes. I want to use this records with win32/win64. In Win32 Pointer size is 4, can be this size 8 bytes? Or any other solutions? type ptr_rec1=^rec1; rec1=record i1:integer; p1:Pointer; end; ptr_rec2=record rec:ptr_rec1; i:integer; p2:Pointer; end; SizeOf(ptr_rec2); //Different sizes for Win32/Win64
  3. Hello everyone, I hope this message finds you all in good health! This year and really weird.... But anyway, let's get back to the point. I recently found a little nugget on the Internet developed by the brilliant @Uwe Raabe : it's a Dataset helper that automatically fills in the properties (or even fields) of an object. The source code can be found at this address : https://www.uweraabe.de/Blog/2017/02/09/dataset-enumerator-reloaded/ I have slightly adapted the source code to use TMS Aurelius attributes (using "Column" attribute instead of "DBField" one provided bu Uwe). The Dataset helper works perfectly well "simple" classes such TCustomer = class private [Column('CustNo')] FCustNo: Double; FCompany: string; FAddress1: string; public [DBField('Addr1')] property Address1: string read FAddress1 write FAddress1; property Company: string read FCompany write FCompany; end; But it gets more difficult as soon as my fields are declared this way: TCustomer = class private [Column('CustNo')] FCustNo: Nullable<Double>;; FCompany: Nullable<String>;; FAddress1: string; FEntity: TObject; public [DBField('Addr1')] property Address1: string read FAddress1 write FAddress1; property Company: string read FCompany write FCompany; property Entity: TObject read FEntity write FEntity; end; At runtime application is throwing "Invalid Type Typecast" exception on every TRTTI.GetValue or TRRTI.SetValue procedure TDataSetHelper.TDataSetRecord<T>.TFieldMapping.LoadFromField(var Target: T); begin FRTTIField.SetValue(GetPointer(Target), TValue.FromVariant(FField.Value)); end; procedure TDataSetHelper.TDataSetRecord<T>.TFieldMapping.StoreToField(var Source: T); begin FField.Value := FRTTIField.GetValue(GetPointer(Source)).AsVariant; end; procedure TDataSetHelper.TDataSetRecord<T>.TPropMapping.StoreToField(var Source: T); begin FField.Value := FRTTIProp.GetValue(GetPointer(Source)).AsVariant; end; procedure TDataSetHelper.TDataSetRecord<T>.TPropMapping.LoadFromField(var Target: T); begin FRTTIProp.SetValue(GetPointer(Target), TValue.FromVariant(FField.Value)); end; I guess this is happening because of either reading/writing values from a Record or an Object. I searched (maybe not enough nor thoroughly) the Internet but I wasn't able to solve this by myself. Can someone helps me sorting this out adapting attached unit to handle simple properties types (integer, double, date, string, boolean....) values as well Nullable one ! (and rejects complex types too 🙂 ) I'll really appreciate some help. Kind regards, Stéphane Ps: I have attached modified Uwe's unit file. Ps2: I'm working with Delphi Sydney Aurelius.Dataset.helper.pas
  4. lefjucabro

    Record and process audio

    Hello there, I am trying to develop an iOS app with Rio. This app must record audio and process it in real time to display some graphs. I am a newbie with FMX platform and iOS, there are lot of informations I don't get There is iOSapi.AVFoundation unit which contains a lot of types (TAVAudioSession, TAVAudioRecorder) but I cannot understand how to use them. For what I understand, I have to define an audio format (2 channels stereo, 16 bits), get the buffer size, create a recording task and then launch recording. In a thread I read samples and fill them into a TMemoryStream for processing. Do you think is this correct ? Do you have any idea how can I do this ? Kind regards Lefjucabro
×