sub MsgIndexOfHeader_mio( $Msg, $HdrNam, $da )
var( $i, $Idx )
$Idx = -1
$i = $da
$HdrNam = LowerCase( $HdrNam )
while( $i < ListCount($Msg) )
if( $HdrNam = LowerCase( MsgHeadernameOfIndex( $Msg, $i ) ) )
$Idx = $i
break
endif
inc( $i )
endwhile
return( $Idx )
endsub
sub MsgGetHeader_mio( $Msg, $HdrNam, $da )
var( $HdrVal, $Idx, $i, $s)
$Idx = MsgIndexOfHeader_mio( $Msg, $HdrNam, $da )
if( $Idx >= 0 )
$HdrVal = ListGet( $Msg, $Idx )
$i = Pos( ":", $HdrVal )
$HdrVal = iif( $i=0, "", copy($HdrVal,$i+1) )
$s = copy( $HdrVal, 1, 1 )
if( Pos($s,$WSP) > 0 )
$HdrVal = Delete( $HdrVal, 1, 1 )
endif
do
inc( $Idx )
$s = copy( ListGet( $Msg, $Idx ), 1, 1 )
break( Pos($s,$WSP)=0 )
$HdrVal = $HdrVal + $CRLF + ListGet( $Msg, $Idx )
loop
else
$HdrVal = ""
endif
return( $HdrVal )
endsub