Local $Str = ''
$Str &= 'Decompress, compress len=[55], orig len=[96] CFtdcUserApiImplBase::HandlePackage FTDC PACKAGE HEADER Version[0X08],Chain[0X4C],SequenceSeries[0],TransactionId[0X0000F103],SequenceNumber[0] FieldCount[2],FTDCContentLength[76],RequestId[0] FTDC PACKAGE CONTENT START FIELD [CFTDMarketDataUpdateTimeField] START [InstrumentID][0][IF1502] [UpdateTime][0][01:42:35] [UpdateMillisec][2][0] FIELD [CFTDMarketDataUpdateTimeField] END FIELD [CFTDMarketDataBestPriceFi'
$Str &= 'eld] START [BidPrice1][4][3609.600000] [BidVolume1][2][50] [AskPrice1][4][3609.800000] [AskVolume1][2][50] FIELD [CFTDMarketDataBestPriceField] END FTDC PACKAGE CONTENT END' & @CRLF & @CRLF & @CRLF
MsgBox(0, '', _GetVal($str, 'InstrumentID') & @LF & _
_GetVal($str, 'UpdateTime') & @LF & _
_GetVal($str, 'UpdateMillisec') & @LF & _
_GetVal($str, 'BidPrice1') & @LF & _
_GetVal($str, 'BidVolume1') & @LF & _
_GetVal($str, 'AskPrice1') & @LF & _
_GetVal($str, 'AskVolume1'))
Func _GetVal($str, $sName)
Local $aSR = StringRegExp($str, '\[' & $sName & '\]\[\d+\]\[(.+?)\]', 1)
If Not @Error Then Return $aSR[0]
EndFunc ;==>_GetVal
|