Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 22 JUN 2009 01:40:07PM Mat Kelly wrote:

I recently upgrade to OI 9.0 from 8.x and am noticing some peculiar behavior with the BTREE.EXTRACT function versus Arev31 and (I believe) OI pre-9.0. It seems that the OPTION parameter is reset to 0 with the function call.

OPTION=1

CALL MSG(OPTION)

CALL BTREE.EXTRACT(SEARCH.STRING,SEARCH.FILE,DICT.FILE,HITS,OPTION,FLAG)

CALL MSG(OPTION)

produces first a message box saying, "1". After the call, the OPTION is said to be "0". Is there any reason why this value would be reset with this function call? I checked the parameters between my Arev31 build and they seem to be the same as this one in Arev32.

Thanks.


At 23 JUN 2009 08:25AM Bob Orsini wrote:

Mat, in your example it is the MSG call that is clearing out the option literal.


At 23 JUN 2009 09:40AM Mat Kelly wrote:

Bob,

Am I understanding this right that a call to MSG function has the side-effect of clearing the value of a variable? If so, what is a better way to get feedback on a variable's value in Arev32?

On a side-note, does a debugger similar to OI's exist for Arev32? Using the built-in arev debugger is like pulling teeth, i.e. I am unsure how to use it effectively.

Thanks!


At 23 JUN 2009 09:48AM Dave Harmacek wrote:

Why don't you change your examination to

X=OPTION

call msg( 'Returned ': quote( X) )

thus, you don't change the value of X

Dave

btw use ? in the debug to see parameters


At 23 JUN 2009 11:54AM Mat Kelly wrote:

Dave, your suggestion led me to the solution of first preserving the OPTION value the restoring it after the call to BTREE.EXTRACT:

X=OPTION

BTREE.EXTRACT(…,OPTION,…)

OPTION=X

However, this still leaves me wondering why the OPTION variable's value is locally corrupted by the call to BTREE.EXTRACT. This doesn't seem to be the case in previous versions of Arev. Am I mis-understanding the intention of the parameters?

Thank again!


At 23 JUN 2009 05:26PM Matthew Crozier wrote:

Or you could just Call Msg( Option:'') - which would effectively pass the Option variable 'by value' instead of 'by reference'. Use Option+0 if you want to pass it as a number.

Cheers, M@

[img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img]

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/5e54e9e61169b2bd852575dd00610ec8.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1