What does “$” mean before a number in Delphi?

前端 未结 3 769
一生所求
一生所求 2021-01-17 14:47

I\'m trying to convert Delphi code to vb.net and I\'m not sure about this line:

stream.Seek($42, soFromBeginning);

I\'m familiar with using

3条回答
  •  鱼传尺愫
    2021-01-17 15:21

    The code required for VB.net is almost identical:

    stream.Seek(&H42, SeekOrigin.Begin)
    

    The points of note here are:

    • $ in Delphi is the prefix for hexadecimal.
    • The soFromBeginning corresponds to SeekOrigin.Begin.

提交回复
热议问题