i := i - $24

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2005
Posts: 42
Reputation: j1979c is an unknown quantity at this point 
Solved Threads: 0
j1979c's Avatar
j1979c j1979c is offline Offline
Light Poster

i := i - $24

 
0
  #1
Aug 4th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 42
Reputation: j1979c is an unknown quantity at this point 
Solved Threads: 0
j1979c's Avatar
j1979c j1979c is offline Offline
Light Poster

Re: i := i - $24

 
0
  #2
Aug 4th, 2006
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:
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Pascal and Delphi Forum


Views: 1594 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC