Page 1 of 1

work area not in use > dbskip

PostPosted: Tue Jul 15, 2008 5:43 pm
by hag
I'm converting a small to 16 bit program to 32 bit as my test case before I move on to my much larger program. The program uses tcbrowse.ch and report.ch. I get the error message: work area not in use > dbskip.

Program works fine in 16 bits. Any idea why I'm getting the error. It says its at the line where I "activate" the oDlg that contains my browse.

All dbskips within the program are indicated as follows: dbf->(dbskip())
Help.

PostPosted: Tue Jul 15, 2008 11:10 pm
by Antonio Linares
Harvey,

Please do a MsgInfo( Alias() ) before calling DbSkip() to check the selected workarea

PostPosted: Wed Jul 16, 2008 3:44 am
by hag
Antonio
I never call a dbskip().. I did the alisa() call and the alias is correct. The first call in error log is: Called from: => DBSKIP(0).
I fixed the prg so no dbskip() is called and still get the error.

This occurs when attempting to load a browse in the oDlg.


Here is the error.log
Application
===========
Path and name: F:\FWH\cashflow\CODATA.EXE (32 bits)
Size: 1,283,584 bytes
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 07/15/08, 20:31:58
Error description: Error DBCMD/2001 Workarea not in use: DBSKIP

Stack Calls
===========
Called from: => DBSKIP(0)
Called from: => TCBROWSE:PAINT(0)
Called from: => TCBROWSE:DISPLAY(0)
Called from: => TCBROWSE:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => DIALOGBOX(0)
Called from: => TDIALOG:ACTIVATE(0)
Called from: codata.prg => CODATA(160)

PostPosted: Wed Jul 16, 2008 6:00 am
by nageswaragunupudi
That means when the dialog is activated the alias is not active or already closed.

Normally this happens when we close the dbf immediately after we activate the window or a nonmodal dialog. In such cases we should close the workarea inside valid clause of the window or nonmodal dialog

PostPosted: Wed Jul 16, 2008 8:33 am
by Antonio Linares
Harvey,

Yes, please do as Nageswararao explains you:

If you use a non modal dialogbox, please check that you are not closing the workarea further on, as the execution will not stop on a non modal dialogbox.

PostPosted: Wed Jul 16, 2008 1:47 pm
by hag
Program is not nonmodal and there is no close in the prg.

The dialog with the browse is called from another dialog which opens fine. I set a msgInfo(alias()) on init when activating the dialog with the browse and the alias is correct.

I think it has something to do with the browse. I think Tcbrowse calls for a dbskip in the class.

All works well in 16 bit but not in 32 bit.

Help

PostPosted: Wed Jul 16, 2008 4:10 pm
by Antonio Linares
Harvey,

Could you provide a small and self contained example to reproduce the error ? thanks

PostPosted: Wed Jul 16, 2008 4:16 pm
by Antonio Linares
Harvey,

Please provide the portion of the code where you create the browse.

PostPosted: Wed Jul 16, 2008 6:13 pm
by hag
Just sent an email with a zip file all things needed in zip file.

PostPosted: Wed Jul 16, 2008 6:28 pm
by Antonio Linares
Harvey,

Please resend it again renamed as .ZOP file, as gmail blocks .ZIP files.

Thanks!

PostPosted: Wed Jul 16, 2008 8:31 pm
by hag
Send the file. Let me know what might be missing. I received a message it didn't like pkzip.exe stripped it out . Don't understand. Never sent pkzip.exe. So let me know what eles you need.

Thanks for your assistance.

PostPosted: Wed Jul 16, 2008 9:37 pm
by Antonio Linares
Harvey,

Ok, I got your files and its already working here.

The problem is that you are mixing two different kinds of FiveWin browses: TCBrowse and TXBrowse, and you should only use one: TXBrowse.

In your resources, please change in dialogbox CODATA: "TCBrowse" into "TXBrowse".

In your PRG use #include "xbrowse.ch" instead of #include "tcbrowse.ch"

Here you have a working sample built from some portions of your code. Please review how I build it and modify your code accordingly, thanks:

test.prg
Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"


function Main()

   local oDlg, oDbf, oBrw

   // SET RESOURCES TO "global.dll".  I am using Test.rc for this test

   USE Codata ALIAS cont1
   DATABASE oDbf

   DEFINE DIALOG oDlg RESOURCE "Codata"

   REDEFINE XBROWSE oBrw ID 101 of oDlg

   ADD COLUMN TO oBrw;
      DATA {|| if( oDbf:industry == repli('-', 30), repli(' ', 30), ;
      if( oDbf:industry == repli('=', 30), repli('_', 30), oDbf:industry)) };
      SIZE 125  LEFT HEADER "Industry" COLOR CLR_BLACK, CLR_WHITE

   ADD COLUMN TO oBrw;
      DATA {|| if( oDbf:industry == repli('-', 30), repli(' ', 30), ;
      if( oDbf:industry == repli('=', 30), repli('_', 30), oDbf:state)) };
      SIZE 80  LEFT HEADER "State" COLOR CLR_BLACK, CLR_WHITE

   oBrw:SetoDbf( oDbf )

   ACTIVATE DIALOG oDlg CENTERED

return nil


Test.rc:
Code: Select all  Expand view
CODATA DIALOG -4, 15, 624, 333
STYLE 0x4L | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Financial Summary"
FONT 8, "MS Sans Serif"
{
CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 12, 8, 600, 292
PUSHBUTTON "&Done", 4002, 554, 308, 54, 18, BS_CENTER | BS_VCENTER | WS_TABSTOP
PUSHBUTTON "Sort ", 102, 470, 308, 54, 18, BS_CENTER | BS_VCENTER | WS_TABSTOP
}

PostPosted: Wed Jul 16, 2008 9:54 pm
by hag
Thanks for the very quick response. I'll be working on it tonight when your sleeping.

Thanks again. Let you know how it works.

PostPosted: Fri Jul 18, 2008 5:19 am
by hag
Antonio

working great.