1. ATK Gimmy Susan
  2. PowerBuilder
  3. Friday, 31 August 2018 14:13 PM UTC


Hello
I created a function with the code below.

How i replace the last parameter (string as_position)
with an enumerated?
What Argument Type should I use?

 Thansk

 

 

 

 


Parameters:
string as_window_name
wn_main_master ao_wn_pointer
string as_position


Code:


[omissis]
choose case as_position
case 'L'
li_rc = OpenSheetDocked (ao_wn_pointer, ls_name, go_ac.of_get_controller_window (), WindowDockLeft! , ls_unique)
'R' case
li_rc = OpenSheetDocked (ao_wn_pointer, ls_name, go_ac.of_get_controller_window (), WindowDockRight! , ls_unique)
'T' case
li_rc = OpenSheetDocked (ao_wn_pointer, ls_name, go_ac.of_get_controller_window (), WindowDockTop! , ls_unique)
case 'B'
li_rc = OpenSheetDocked (ao_wn_pointer, ls_name, go_ac.of_get_controller_window (), WindowDockBottom! , ls_unique)
end choose

[omissis]

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 31 August 2018 18:00 PM UTC
  2. PowerBuilder
  3. # Permalink

PowerBuilder doesn't support user defined enumerations. As Shenn said, C and similar languages allow for creating enumerated types which are like a constant integer in the PB world.

The datatype of the position argument is windowdocposition. You can use that as the datatype of the argument. It won't be in the dropdown, you have to type it in manually.

 

Comment
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Saturday, 1 September 2018 14:25 PM UTC
  2. PowerBuilder
  3. # 1

You can sorta create enums by creating an nvo, e.g. u_nvo_my_enum, and declaring an integer instance variables on it, e.g.

 

Public:

integer enum1 = 1

integer enum2 = 2

 

Then in you code you can do the following:

Create a global instance on u_nvo_my_enum, like so

gnv_my_enum = CREATE u_nvo_my_enum 

 

Then whenever you want to reference an enum, as long as you have autoscript on (which makes it easier to find the one you want) you just do gnv_my_enum.enum2.

That way you can group your enums by a nice name (gnv_my_enum) and acecss them by a nice name in code.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 1 September 2018 02:28 AM UTC
  2. PowerBuilder
  3. # 2

Hi Gimmy;

  Looks like your using my "Intergrated" framework. Have a look at the Framework's global functions for the OpenSheetDocked and other MDI Docked commands (ie: fn_opensheet_docked) and use them instead.

HTH

Regards ... Chris

Comment
There are no comments made yet.
Shenn Sellers Accepted Answer Pending Moderation
  1. Friday, 31 August 2018 17:40 PM UTC
  2. PowerBuilder
  3. # 3

Enumerated Data Types are just Integers.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.