Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Using External Code in LabVIEW.pdf
Скачиваний:
91
Добавлен:
29.05.2015
Размер:
1.85 Mб
Скачать

Chapter 6 Function Descriptions

CPStrInsert

MgErr CPStrInsert(s1h, s2, index);

Purpose

Inserts a new Pascal string before the index numbered Pascal string in a concatenated list of Pascal strings. If index is greater than or equal to the number of strings in the list, this function places the new string at the end of the list. The function resizes the list to make room for the new string.

Parameters

Name

Type

Description

 

 

 

 

 

 

s1h

CPStrHandle

Handle to a concatenated list of Pascal

 

 

strings.

 

 

 

s2

PStr

Pointer to a Pascal string.

 

 

 

index

int32

Position you want the new Pascal string to

 

 

have in the list of Pascal strings, with 0 as the

 

 

first string.

 

 

 

Return Value

mgErr, which can contain the following errors:

mFullErr

Insufficient memory.

Using External Code in LabVIEW

6-42

www.ni.com

Chapter 6 Function Descriptions

CPStrLen

Macro

int32 CPStrLen(sp);

Purpose

Returns the number of Pascal strings in a concatenated list of Pascal strings, that is, sp->cnt. Use the CPStrSize function to get the total number of characters in the list.

Parameters

Name

Type

Description

 

 

 

 

 

 

sp

CPStrPtr

Pointer to a concatenated list of Pascal

 

 

strings.

 

 

 

Return Value

The number of strings in the concatenated list of Pascal strings.

© National Instruments Corporation

6-43

Using External Code in LabVIEW

Chapter 6 Function Descriptions

CPStrRemove

void CPStrRemove(s1h, index);

Purpose

Removes a Pascal string from a list of Pascal strings. If index is greater than or equal to the number of strings in the list, this function removes the last string. The function resizes the list after removing the string.

Parameters

Name

Type

Description

 

 

 

 

 

 

s1h

CPStrHandle

Handle to a concatenated list of Pascal

 

 

strings.

 

 

 

index

int32

Number of the string you want to remove,

 

 

with 0 as the first string.

 

 

 

Using External Code in LabVIEW

6-44

www.ni.com

Chapter 6 Function Descriptions

CPStrReplace

MgErr CPStrReplace(s1h, s2, index);

Purpose

Replaces a Pascal string in a concatenated list of Pascal strings with a new Pascal string.

Parameters

Name

Type

Description

 

 

 

 

 

 

s1h

CPStrHandle

Handle to a concatenated list of Pascal

 

 

strings.

 

 

 

s2

PStr

Pointer to a Pascal string.

 

 

 

index

int32

Number of the string you want to replace,

 

 

with 0 as the first string.

 

 

 

Return Value

mgErr, which can contain the following errors:

mFullErr

Insufficient memory.

© National Instruments Corporation

6-45

Using External Code in LabVIEW

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]