944,084 Members | Top Members by Rank

Ad:
Aug 4th, 2006
0

i := i - $24

Expand Post »
Errr... anyone knows what this means in Delphi language?

Pascal and Delphi Syntax (Toggle Plain Text)
  1. i : integer;
  2.  
  3. i := i - $24;

It's actually in a function that completes a WAV file header something similar to the Microsoft's RIFF specification for WAV. The code goes something like this.

Pascal and Delphi Syntax (Toggle Plain Text)
  1. procedure TForm1.StopRecording;
  2. var
  3. i: integer;
  4. begin
  5. BASS_ChannelStop(rchan);
  6. bRecord.Caption := 'Record';
  7. WaveStream.Position := 4;
  8. i := WaveStream.Size - 8;
  9. WaveStream.Write(i, 4);
  10. i := i - $24;
  11. WaveStream.Position := 40;
  12. WaveStream.Write(i, 4);
  13. WaveStream.Position := 0;
  14. // create a stream from the recorded data
  15. chan := BASS_StreamCreateFile(True, WaveStream.Memory, 0, WaveStream.Size, 0);
  16. if chan <> 0 then
  17. begin
  18. // enable "Play" & "Save" buttons
  19. bPlay.Enabled := True;
  20. bSave.Enabled := True;
  21. end
  22. else
  23. MessageDlg('Error creating stream from recorded data!', mtError, [mbOk], 0);
  24. end;

I could understand what the rest are doing but I kinda puzzled with the $24 thing...any clues?

Thanks in advance.
Reputation Points: 13
Solved Threads: 1
Light Poster
j1979c is offline Offline
42 posts
since Sep 2005
Aug 4th, 2006
0

Re: i := i - $24

Oh ok ... stupid me...

$24 means a value of 36

just a hexadecimal thing like $10 is the same as A in Hex.

Got confused it with compiler directives.... :mrgreen:

Thanks to myself...:cheesy:
Reputation Points: 13
Solved Threads: 1
Light Poster
j1979c is offline Offline
42 posts
since Sep 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Visual wave editing with delphi 7
Next Thread in Pascal and Delphi Forum Timeline: Record Files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC