Yup.. di PB beberapa error emang udah disediain handlenya
misal di  transaction SQLCA, datawindow, dll

td nyoba bikin Function yang manggil object MSComm bwt ngecek port modem yg aktif..
masalahnya.. untuk tau aktif atau tidaknya suatu port, cara ngeceknya adalah dengan error/tidak saat koneksi dengan MSComm tadi..
kalo saat di set MSComm.PortOpen = True -> Sukses berarti port aktif,
jika saat di set MSComm.PortOpen = True -> Error berarti port tidak aktif...

masalahnya.. kalo di PB
begitu nemu error langsung muncul "PowerBuilder Application Execution Error"

berikut kalo script di VB
------------------------------------------

On Error GoTo EHIsModem
Dim t As Double
Dim s As String

IsModem = False
If c.PortOpen Then c.PortOpen = False
c.CommPort = p
c.PortOpen = True 'if port doesn't exist, an error will take us to the exit...
 ...
EHIsModem:
End Function

---------------------------------







Donny Irsandi wrote:
 

klo di pb on error langsung masuk ke event, misal: systemerror, dberror atau other (event other ga disaranin diisi script)
coba lihat contoh di PFC gimana cara ngatur error deh

On Fri, Jun 10, 2011 at 9:53 AM, hotdin gurning <[email protected]> wrote:
 
Kalo GOTO yang di PB itu sebenarnya label, sama kayak di pascal. Jadi saya pikir, bukan utk error handle.

 Pak DP ada contoh kasus kah?biar lebih jelas.. soalnya susah ngebandingin VB sama PB.

Best Regards,


Hotdin Gurning
HP : 0813 8811 4416
Y! : hotdin_gurning
www.gurningsoft.com




Dari: Djoko Prasetiyo <[email protected]>
Kepada: "[email protected]" <[email protected]>
Dikirim: Jumat, 10 Juni 2011 9:41
Judul: RE: [indopb] Error Handle di PB

 
Ada, dan bias pakai GOTO…. Di PB
Aku pernah coba,…
 
From: [email protected] [mailto:[email protected]] On Behalf Of Hermawan Dephe
Sent: Friday, June 10, 2011 9:11 AM
To: [email protected]
Subject: Re: [indopb] Error Handle di PB
 
 
sepertinya kalo di PB 6.5 ga ada pak.. :)


[email protected] wrote:
 
Udh cb pake try-catch!
Powered by Telkomsel BlackBerry®

From: Hermawan Dephe <[email protected]>
Date: Fri, 10 Jun 2011 08:50:46 +0700
Subject: [indopb] Error Handle di PB
 
 
Kalo di VB kan ada tuh ya
ON ERROR RESUME NEXT
ON ERROR GOTO ...

Kalo di PB ada ga ya??
 
***** This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. PT Pertamina (Persero) is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. *****






__._,_.___


-----------------------------------------------
IndoPB - Indonesia PB User Group
http://groups.yahoo.com/group/indopb




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Kirim email ke