cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to return a string vector from a custom function?

jlemay
1-Visitor

How to return a string vector from a custom function?

I am working on a custom function and I would like it to return something like this:

Capture.PNG

In MCADINCL.H, the only return formats defined are:

// types to be used in declaration of the function's

// arguments and of the return value

#define COMPLEX_SCALAR  1

#define COMPLEX_ARRAY   2

#define STRING 8


There is no STRING_ARRAY, is there a way I can do this?

Something similar is done in this thread: import data with dat file and string

Thanks in advance

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:jlemay)

What you want is not officially supported.

By inspecting how Mathcad supplies a string vector to a function I have figured out the structure and wrote a custom function that returned a vector of strings. It worked (in Mathcad 11).... but sometimes not, and sometimes led to crashing mathcad.

The method is (most probably) related to patent 5,771,392 as mentioned in Have the original Mathsoft patents lapsed, and will there be any competitors soon?

Luc

View solution in original post

1 REPLY 1
LucMeekes
23-Emerald III
(To:jlemay)

What you want is not officially supported.

By inspecting how Mathcad supplies a string vector to a function I have figured out the structure and wrote a custom function that returned a vector of strings. It worked (in Mathcad 11).... but sometimes not, and sometimes led to crashing mathcad.

The method is (most probably) related to patent 5,771,392 as mentioned in Have the original Mathsoft patents lapsed, and will there be any competitors soon?

Luc

Announcements

Top Tags