strunpack()

strunpack()

Description

Create an “unpacked” copy of a string.

Syntax

strunpack(dest[], source[], maxlength);

Parameters

Variable

Input

Variable

Input

dest[]

The buffer to store the unpacked string in

source[]

The string to copy, this may be a packed or an unpacked string

maxlength

The size of dest[] in cells. If the length of dest[] would exceed maxlength cells, the result is truncated

Returns

The number of characters copied.

Function call example

Example of unpacked line copying
new data1[20]; new array2[20]="oldTextold"; main(){ strunpack(data1, array2, sizeof data1); // result of data1 will be (in ASCII): oldTextold<0><0><0><0><0><0><0><0><0><0> unpacked while(1){ Delay(100); } }

Notes and Warnings

  • This function copies a string from source to dest and stores the destination string in unpacked format.

  • The source string may either be a packed or an unpacked string.