Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Jun 22, 2012

Powerbuilder - Open Window As String

Example for open window as string.

string ls_name
window lw_sheet
ls_name = "w_customer"
open(lw_sheet,ls_name)

As simple as that.
Cheers..

Jan 16, 2012

Replace string function

Sample : f_replace(powerbuilder,r,s) will return powesbuildes


f_replace(string as_text,string as_before,string as_after)  returns string

integer li_Posisi
string ls_return

li_Posisi = pos(as_text,as_before)
do while li_Posisi > 0
    ls_return += mid(as_text,1,li_Posisi - 1) + as_after
    as_text = mid(as_text, li_Posisi + Len(as_before))
    li_Posisi = pos(as_text,as_before)
loop
ls_return += as_text

return ls_text

cheers..

Jan 15, 2012

Keycode to string

With most objects, you can trap the key strokes using user events.
For example, on a datawindow object,
you can create a user event using Event Id = pbm_dwnkey.
In this event, you'll find a parameter of type keycode.
This is a predefined enumerated data type with values such as KeyA!, KeyB!, etc.
But if you want to convert this value to a string,
you'll find your choices are limited.
It looks something like this :

choose case a_key
       case keyA!
            ls_string = "A"
       case keyB!
            ls_string = "B"
       case keyC!
           ls_string = "C"
...
end choose




As simple as that!
Cheers..

Are legacy 4GL applications keeping you from embracing modern technologies?

As the competitive advantages offered by cloud, mobile, and other new technologies become more apparent, the decision to migrate legacy 4GL ...