Skip to main content
1-Visitor
February 29, 2016
Solved

How to return a string vector from a custom function?

  • February 29, 2016
  • 1 reply
  • 1337 views

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

Best answer by LucMeekes

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

1 reply

LucMeekes23-Emerald IVAnswer
23-Emerald IV
February 29, 2016

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