Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
returns integer not text
#4
I'm a newbie here also. I'm just picking things up here and there in the QM world only. So for your question I could answer the first part "is that QM hieroglyphs or standard C++?".

When you declare a sub by using "#sub <name>" keyword, you actually declare a subroutine or function. Usually most of the time in QM your "#sub <name>" function is doing some additional stuff and don't need to return anything. But in your case you need a return value.

So you have to know that by default the return type of a "#sub" or funtion is an integer. In your case you need a string. So you need to explicitly tell it to do that. In your case the return type of "string" is a tilda sign "~". That's why you see I've mentioned about it "function~". This is QM syntax and not C++ standard. Another straigtforward way is using this "function'str" for the string return type is okay too.

The function statement is optional. Use it when need parameters or when the function returns something (uses ret).

You could look up for more on function types in QM help doc.


Messages In This Thread
returns integer not text - by ilcaa - 07-29-2020, 03:30 PM
RE: returns integer not text - by Start_Learning - 07-29-2020, 06:19 PM
RE: returns integer not text - by ilcaa - 07-31-2020, 02:52 PM
RE: returns integer not text - by Start_Learning - 07-31-2020, 04:44 PM
RE: returns integer not text - by ilcaa - 07-31-2020, 08:06 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)