Posts: 76
Threads: 37
Joined: Nov 2018
i am trying to return the text string but it only returns numbers.
it should return,
test.cpp it returns 85752528 for some reason i cant figure out
thank you
out
str a= sub.t
out a
#sub t
str a =("C:\SierraChart\ACS_Source\test.cpp - Notepad++ [Administrator] Notepad++")
int b = findcr(a "\")+1
int c = findcr(a ".cpp")+4
str d
ret d.get(a b c-b )
Posts: 117
Threads: 5
Joined: Nov 2015
07-29-2020, 06:19 PM
(This post was last modified: 07-29-2020, 06:22 PM by Start_Learning.)
Add this line after "#sub t"
function~
Posts: 76
Threads: 37
Joined: Nov 2018
thank you!! question. is that QM hieroglyphs or standard C++?
can you help me understand this....what does this mean?
the * after datatype & before variable?
the + in front of GetProp? thanks
TBATC* t = +GetProp(hWnd "TBATC")
Posts: 117
Threads: 5
Joined: Nov 2015
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.
Posts: 76
Threads: 37
Joined: Nov 2018