Kamis, 25 September 2008

Happy Ied Day 1429 H



Minal Aidzin Wal Faidzin, Please
Forgive all of my mistakes with all your heart, and we will be meet again after ied holliday with many script in SCRIPTROOM blog

Selasa, 23 September 2008

Power Builder - Script for using Horizontal ProgressBar Control

If you want to use Horizontal ProgressBar Control for many process, you can following this sintax
hpb_1.SetRange(0, li_row)
hpb_1.SetStep = 1
ll_start = cpu()
for i = 1 to li_row
hpb_1.offsetpos(1)
st_100.Text = string(round( i / li_row * 100, 0) ) + '%'
............ ( sintax )
............ ( sintax )
ll_used = cpu() - ll_start
st_time.Text = string( RelativeTime(Time(0,0,0), ll_used / 1000), 'hh:mm:ss')
next

Power Builder - Get Current Directory

We can get current active directory of application , the output of variable is string.
string ls_temp
ulong lul_value
boolean lb_rc

lul_value = 255
ls_temp = space(255)
lb_rc = GetCurrentDirectoryA( lul_value,ls_temp)
If lb_rc Then sle_path.text=ls_temp

Senin, 22 September 2008

Power Builder - Using Enter For Change Column Pointers


if you want to be use enter to change pointer for every each column you can use even rowenter in data windows and then you can using this script :
Send(Handle(This), 256, 9, Long(0, 0))
Message.Processed = TRUE
Message.ReturnValue = 1

Power Bulider 7 - Manage Database Console





you can use profile ( native / odbc) to connect database and then manage table to create / modify evey each property of tables

Power Builder - Adding Table for ASA Database

//===adding table for ASA database=======
select count(*) into :li_table from systable where table_name = upper('saldo_rekmtr');

if li_table = 0 then
ls_add = 'CREATE TABLE "dba"."saldo_rekmtr" ' +&
'("kd_unit" char(5) NOT NULL DEFAULT NULL,' +&
'"rek" varchar(9) NOT NULL DEFAULT NULL, ' +&
'PRIMARY KEY ("kd_unit"")) ;'
execute immediate :ls_add;
ls_idx = 'CREATE UNIQUE INDEX "idx_saldorekmtr" ON "dba"."saldo_rekmtr" ' +&
'("kd_unit") ;'
execute immediate :ls_idx;
end if

Power Builder - Adding Table Sintax

//===if using oracle you can use this sintax for adding table===
Select count(*) Into :ll_adabaris from user_tables
Where lower(table_name) = 'debitur' ;
IF sqlca.sqlcode = 100 or ll_adabaris = 0 Then
ls_sql = "create table sample_b.debitur (kar_nik char(6) not null, kd_kredit char(5) not null, no_setuju varchar2(25) not null, tgl_setuju date, keterangan1 varchar2(25)," +&
"primary key ( kar_nik, kd_kredit, no_setuju ))"
Execute immediate :ls_sql ;
IF sqlca.sqlcode <> 0 Then
Beep(1)
MessageBox('Information', "must add table...")
Return
End IF
End IF