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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to return a string vector from a custom function?

jlemay
1-Newbie

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

1 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

Top Tags