Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter passing question 2

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi Everyone,

I noticed that you can pass a parameter to a procedure. What I would like to do is pass a value to a listbox in a browse that I created with the wizard. I would like to take that value to re-position the listbox highligh when the browse window is displayed. I would be calling the browse procedure via an entry field in a form defined as a lookup field.

Is it possible to do this? Maybe there is something I can set when defining the actions of the lookup field in the form to do the same thing.

Thanks.

Emad
 
Hi Emad,

You cannot pass a value to a ListBox. What you can do is pass a value to the Procedure which contains the ListBox and do what you want on the variable(s) received. With more specifics like variable/column/table name, I can give you a meaningful code.

Regards
 
Hi ShankarJ,

Ok.

I was thinking about passing LAYAWAY:MaterialType to the browse procedure as a parameter and using that in an embed point (which I don't know the proper one) where I would populate the key field ITEM:MaterialType and issue a GET plus code you had already taught me to use to position the listbox highlight bar.

Thanks for the help.

Truly,
Emad
 
Hi Emad,

If the Browse Procedure is being called from the Application Frame i.e. STARTed, you cannot have Optional Parameters. Also, all parameters must be Strings. Assuming that we make the Parameter mandatory, this is what you can do :

1. Set the Prototype and the Parameter in the Procedure Properties as (STRING INP:MaterialType)
2. On Window Events - OpenWindow - after Parent Call, execute the necessary code i.e. GET(..) followed by a BRWn.ResetBuffer() if INP:MaterialType is not BLANK.

If this procedure is being called/STARTed from the Frame, set the parameters as ('') i.e. passing a Blank MaterialType.

Regards
 
Hi ShankarJ,

The procedure is called from a lookup field in a form procedure.

Truly,
Emad
 
Hi ShankarJ,

I am now at the computer with the Clarion program so I would like to supply actual field names, etc. so maybe you can tell me how to proceed.

I believe I am missing several steps.

In "When control is accepted" from the form procedure I have LAY:Description

In from the browse procedure properties I have STRING IN:description in the "Prototype" and the "Parameter" fields, but I get errors when I compile the app.

I added also added a string variable in the data section of the browse procedure with IN:description but still get errors when I compile the app.

Can you tell me what I did wrong?

Thanks.

Emad

 
Hi Emad,

You have to use parentheses around it i.e. (STRING IN:description). You do not need to add the parameter variable to the Local Data. If you want to use this value in a template i.e. other than hand code, define a local variable called SEL:description and assign IN:description to it i.e. SEL:description = IN:description in the WindowManager.INIt procedure.

What compile errors are you getting?

Regards
 
Hi ShankarJ,

I was getting these:
Make error: Expected: <ID> <LINEBREAK>; END INCLUDED....
Syntax error: Illegal data type: PROCEDURESTRING
Syntax error: Invalid data declaration attribute
Make error: Expected: <EOF> <ID> <LINEBREAK>; INCLUDE.....
Make error: Expected: <ID> <LINEBREAK>; CODE INCLUDED....
Syntax error: Unknown procedure label
Syntax error: Missing procedure defination: UPDATELAYAWAY

By the way, I was able to figure out why my listbox in the lookup browse procedure was not working. It was because I accidently used the target values in the "Lookup Key", and "Lookup Field" when I needed to use the actual lookup values for those.

Thanks.

Truly,
Emad

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top