Skip to content

Read_Hex

Include: Use System\FileSystem.pkg

See Also: Direct_Input, Read, Read_Line, Read_Block, Write_Hex, Sequential Channels

Purpose

Reads hex-encoded text and converts it back to bytes or text.

Syntax

Read_Hex [Channel {ChannelNumber}] {Variable} {Count}

Behavior

Read_Hex reads hex characters, stops at the first non-hex character or requested count, decodes pairs into bytes/text, and assigns the decoded value to the destination.

Count -1 or any non-positive count means all remaining hex input.

Use Seq_New_Channel when opening files in application code; see Sequential Channels.

Example

Handle hFile
String sText

Get Seq_New_Channel to hFile
Direct_Input Channel hFile FILE "hex.txt"
Read_Hex Channel hFile sText -1
Close_Input Channel hFile
Send Seq_Release_Channel hFile