views:

76

answers:

1

Please clue this newb in.

I've got a menu with it's object type set to menu cascade. I can reference the items in the menu just fine and I can even st the items to enabled or visible. But what I can't do is set the currentItem property of the menu. I have code like this in the open event of a screen.

menu qq
qq = this.menuid.item[3].item[19]

qq.visible = true           //OK
qq.item[3] = qq.item[3]     //OK
qq.currentitem = qq.item[3] //Error during the compile
// The line above gives the following error
// C0019: Incompatible property currentitem for type menu

I pretty sure it's an easy fix but PowerBuilder is not my friend yet

+4  A: 

You need to assign the item to a variable of type menucascade. I would put the code inside a Try...Catch block in case the menu is later modified.

Hugh Brackett
Thank you very much
telesphore4