MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

MessageObject for comunication between Windows in PowerBuilder using Structures

Published on 24 September 16
1559
0
1
If we need to pass more than one parameters of differant datatypes(including datawindows,powerobjects) from one window to another window ,we will be using the structure object in PowerBuilder

in the below example I am using two windows
1. w_main --> It is a main window
2. w_response --> it is the response window
3. str_1 --> is the structure object with which we will be passing parameters from one window to another window
MessageObject for comunication between Windows in PowerBuilder using Structures - Image 1
// In the mainwindow open event :

str_1 lstr_response

open(w_response)
//opening response window
// Below diagram shows the response window and its code

lstr_response=message.powerobjectparm
// capturing the structure from response window
// Assign the values to the window controls.
//This code will look like exact opposite code which we used in Response window

em_2.text=string(lstr_response.ldt_datetime)
em_1.text=string(lstr_response.li_integer)
em_3.text=string(lstr_response.ll_long)
sle_1.text=string(lstr_response.ls_name)

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 2
// Object :: OK Button of response window
str_1 lstr_response

lstr_response.ldt_datetime=datetime(em_2.text)
lstr_response.li_integer=integer(em_1.text)
lstr_response.ll_long=long(em_3.text)
lstr_response.ls_name=sle_1.text

closewithreturn(parent,lstr_response)

// Below Image Contains the structure details

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 3
// Final Output
// First response window opens as per the mainwindow logic
// once we enter the details and clicks the ok button, the values from
// response window will be assigned to mainwindow
MessageObject for comunication between Windows in PowerBuilder using Structures - Image 4
MessageObject for comunication between Windows in PowerBuilder using Structures - Image 5
If we need to pass more than one parameters of differant datatypes(including datawindows,powerobjects) from one window to another window ,we will be using the structure object in PowerBuilder

in the below example I am using two windows

1. w_main --> It is a main window

2. w_response --> it is the response window

3. str_1 --> is the structure object with which we will be passing parameters from one window to another window

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 1

// In the mainwindow open event :

str_1 lstr_response

open(w_response)

//opening response window

// Below diagram shows the response window and its code

lstr_response=message.powerobjectparm

// capturing the structure from response window

// Assign the values to the window controls.

//This code will look like exact opposite code which we used in Response window

em_2.text=string(lstr_response.ldt_datetime)

em_1.text=string(lstr_response.li_integer)

em_3.text=string(lstr_response.ll_long)

sle_1.text=string(lstr_response.ls_name)

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 2

// Object :: OK Button of response window str_1 lstr_response

lstr_response.ldt_datetime=datetime(em_2.text)

lstr_response.li_integer=integer(em_1.text)

lstr_response.ll_long=long(em_3.text)

lstr_response.ls_name=sle_1.text

closewithreturn(parent,lstr_response)

// Below Image Contains the structure details

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 3

// Final Output// First response window opens as per the mainwindow logic

// once we enter the details and clicks the ok button, the values from

// response window will be assigned to mainwindow

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 4

MessageObject for comunication between Windows in PowerBuilder using Structures - Image 5

This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top