Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

gettext() bad runtime function

3 posts in DataWindow Last posting was on 2009-04-27 11:25:40.0Z
rusty.rickmon Posted on 2009-04-24 18:38:40.0Z
From: rusty.rickmon@gmail.com
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: gettext() bad runtime function
Date: Fri, 24 Apr 2009 11:38:40 -0700 (PDT)
Organization: http://groups.google.com
Lines: 60
Message-ID: <7358772a-7a0d-4e5f-a581-a7e05712a763@q16g2000yqg.googlegroups.com>
NNTP-Posting-Host: 20.137.18.50
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1240598320 24960 127.0.0.1 (24 Apr 2009 18:38:40 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 24 Apr 2009 18:38:40 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: q16g2000yqg.googlegroups.com; posting-host=20.137.18.50; posting-account=_oNgbwoAAAB-Q_Yxc34dNehkz2iOG4Ze
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!q16g2000yqg.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89197
Article PK: 418449

We upgraded our application from PB9.0 to 11.5.

We have a datawindow control on a window with the following code in
the doubleclicked event:
string s_dwobject

string s_column
long l_row
s_dwobject = GetObjectAtPointer()

if not IsNull(s_dwobject) then
s_column = f_get_token(s_dwobject, "~t")
l_row = Long(f_get_token(s_dwobject, "~t"))

if s_column <> GetColumnName() then
return
elseif l_row <> GetRow() then
return
elseif l_row > 0 then
string s_request, s_colname, s_coltype, s_editstyle
s_colname = This.GetColumnName()
s_request = s_colname + ".coltype"
s_coltype = This.Describe(s_request)
s_request = s_colname + ".edit.style"
s_editstyle = This.Describe(s_request)
if Left(s_coltype, 4) = "char" and s_editstyle =
"edit" then
open(w_zoom)
end if
end if
end if


Upon calling w_zoom that has a MLE control, we execute the following
code:

string s_request
string s_response
string ls_name

go_activecontrol = GetFocus()
dw_activedatawindow = go_activecontrol
mle_notepad.text = dw_activedatawindow.GetText()
s_request = dw_activedatawindow.GetColumnName() + ".Edit.DisplayOnly"
s_response = dw_activedatawindow.Describe(s_request)
if Upper(s_response) <> "NO" then
mle_notepad.Enabled = FALSE
cb_execute.Enabled = FALSE
end if

This code worked in 9.0 but aborts with a bad runtime function on the
following line:
mle_notepad.text = dw_activedatawindow.GetText()

If anyone has an idea on getting around the runtime error, I would
greatly appreciate it.


Rusty


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2009-04-24 21:11:09.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <7358772a-7a0d-4e5f-a581-a7e05712a763@q16g2000yqg.googlegroups.com>
Subject: Re: gettext() bad runtime function
Lines: 77
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49f22aed$1@forums-1-dub>
Date: 24 Apr 2009 14:11:09 -0700
X-Trace: forums-1-dub 1240607469 10.22.241.152 (24 Apr 2009 14:11:09 -0700)
X-Original-Trace: 24 Apr 2009 14:11:09 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89198
Article PK: 418452

I'm guessing your code is in the Open event of w_zoom. Nothing has focus
yet. GetFocus returns null.
Confirm by using the debugger.
Possible workaround: put that code in an event to be posted from Open - when
Open completes focus should go to the visible and enabled control with the
lowest tab order.
Or do a SetFocus if you know where it should go.

--
Report Bugs: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

<rusty.rickmon@gmail.com> wrote in message
news:7358772a-7a0d-4e5f-a581-a7e05712a763@q16g2000yqg.googlegroups.com...
> We upgraded our application from PB9.0 to 11.5.
>
> We have a datawindow control on a window with the following code in
> the doubleclicked event:
> string s_dwobject
>
> string s_column
> long l_row
> s_dwobject = GetObjectAtPointer()
>
> if not IsNull(s_dwobject) then
> s_column = f_get_token(s_dwobject, "~t")
> l_row = Long(f_get_token(s_dwobject, "~t"))
>
> if s_column <> GetColumnName() then
> return
> elseif l_row <> GetRow() then
> return
> elseif l_row > 0 then
> string s_request, s_colname, s_coltype, s_editstyle
> s_colname = This.GetColumnName()
> s_request = s_colname + ".coltype"
> s_coltype = This.Describe(s_request)
> s_request = s_colname + ".edit.style"
> s_editstyle = This.Describe(s_request)
> if Left(s_coltype, 4) = "char" and s_editstyle =
> "edit" then
> open(w_zoom)
> end if
> end if
> end if
>
>
> Upon calling w_zoom that has a MLE control, we execute the following
> code:
>
> string s_request
> string s_response
> string ls_name
>
> go_activecontrol = GetFocus()
> dw_activedatawindow = go_activecontrol
> mle_notepad.text = dw_activedatawindow.GetText()
> s_request = dw_activedatawindow.GetColumnName() + ".Edit.DisplayOnly"
> s_response = dw_activedatawindow.Describe(s_request)
> if Upper(s_response) <> "NO" then
> mle_notepad.Enabled = FALSE
> cb_execute.Enabled = FALSE
> end if
>
> This code worked in 9.0 but aborts with a bad runtime function on the
> following line:
> mle_notepad.text = dw_activedatawindow.GetText()
>
> If anyone has an idea on getting around the runtime error, I would
> greatly appreciate it.
>
>
> Rusty
>


Chris Pollach Posted on 2009-04-27 11:25:40.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <7358772a-7a0d-4e5f-a581-a7e05712a763@q16g2000yqg.googlegroups.com>
Subject: Re: gettext() bad runtime function
Lines: 88
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49f59634@forums-1-dub>
Date: 27 Apr 2009 04:25:40 -0700
X-Trace: forums-1-dub 1240831540 10.22.241.152 (27 Apr 2009 04:25:40 -0700)
X-Original-Trace: 27 Apr 2009 04:25:40 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89201
Article PK: 418453

Hi Rusty;

You should always check the result of the GetFocus ( ) method.
In your case ...

IF IsValid (go_activecontrol) = TRUE Then
dw_activedatawindow = go_activecontrol
mle_notepad.text = dw_activedatawindow.GetText()
....

Remember that event timing and order have changed slightly in newer PB's as
well as the O/S's. Most likely, there is a small point in time where there
is no current control focus.


HTH


--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com

<rusty.rickmon@gmail.com> wrote in message
news:7358772a-7a0d-4e5f-a581-a7e05712a763@q16g2000yqg.googlegroups.com...
> We upgraded our application from PB9.0 to 11.5.
>
> We have a datawindow control on a window with the following code in
> the doubleclicked event:
> string s_dwobject
>
> string s_column
> long l_row
> s_dwobject = GetObjectAtPointer()
>
> if not IsNull(s_dwobject) then
> s_column = f_get_token(s_dwobject, "~t")
> l_row = Long(f_get_token(s_dwobject, "~t"))
>
> if s_column <> GetColumnName() then
> return
> elseif l_row <> GetRow() then
> return
> elseif l_row > 0 then
> string s_request, s_colname, s_coltype, s_editstyle
> s_colname = This.GetColumnName()
> s_request = s_colname + ".coltype"
> s_coltype = This.Describe(s_request)
> s_request = s_colname + ".edit.style"
> s_editstyle = This.Describe(s_request)
> if Left(s_coltype, 4) = "char" and s_editstyle =
> "edit" then
> open(w_zoom)
> end if
> end if
> end if
>
>
> Upon calling w_zoom that has a MLE control, we execute the following
> code:
>
> string s_request
> string s_response
> string ls_name
>
> go_activecontrol = GetFocus()
> dw_activedatawindow = go_activecontrol
> mle_notepad.text = dw_activedatawindow.GetText()
> s_request = dw_activedatawindow.GetColumnName() + ".Edit.DisplayOnly"
> s_response = dw_activedatawindow.Describe(s_request)
> if Upper(s_response) <> "NO" then
> mle_notepad.Enabled = FALSE
> cb_execute.Enabled = FALSE
> end if
>
> This code worked in 9.0 but aborts with a bad runtime function on the
> following line:
> mle_notepad.text = dw_activedatawindow.GetText()
>
> If anyone has an idea on getting around the runtime error, I would
> greatly appreciate it.
>
>
> Rusty
>