Page 1 of 2
"Workarea not in use" Error
Posted: Thu Mar 29, 2018 8:01 am
by asharpham
I have these 2 lines of code:
USE Library NEW
dbGoBottom()
which compiles fine but gives me this runtime error:
"Workarea not in use: DBGOBOTTOM".
I've looked at samples and right through the documentation but can't see why I'm gettiong this error. I would have thought opening the database and then navigating it should work.
Regards,
Alan
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 8:28 am
by esgici
asharpham wrote: ↑Thu Mar 29, 2018 8:01 am
I have these 2 lines of code:
USE Library NEW
dbGoBottom()
which compiles fine but gives me this runtime error:
"Workarea not in use: DBGOBOTTOM".
I've looked at samples and right through the documentation but can't see why I'm gettiong this error. I would have thought opening the database and then navigating it should work.
Regards,
Alan
Hi Alan
Probably your file "Library" didn't open.
You can use
USED() function just after USE command and before any database command / function to test database file is successfully open; and / or
FILE() function before USE command to check existence of yor file.
Happy HMG'ing

Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 8:39 am
by dragancesu
Command USE TABLE NEW
should only appear once in the program
If it's already open it can not again (maybe it can clipper, it can not hmg)
If is possible save problematic program in the zip and add it to the attachment,
it will be easier for everyone who wants to help
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 10:25 am
by asharpham
I did this:
IF USED()
dbGoBottom()
ELSE
USE Library NEW
dbGoBottom()
ENDIF
but got the same result.
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 10:35 am
by edk
Try to ask for an open alias before dbGoBottom ().
Code: Select all
USE Library NEW
MsgBox( Alias(), 'Active Alias' )
dbGoBottom()
What is the active alias?
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 11:08 am
by Anand
asharpham wrote: ↑Thu Mar 29, 2018 10:25 am
I did this:
IF USED()
dbGoBottom()
ELSE
USE Library NEW
dbGoBottom()
ENDIF
but got the same result.
Hi asharpham
The correct code is
Code: Select all
USE Library NEW
IF USED()
dbGoBottom()
ENDIF
Regards,
Anand
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 1:02 pm
by serge_girard
Hi Alan,
I have no problems with this:
If this gives error with your file, I think your file is corrupted (long filed name?)
Try to dbcreate it again with :
Code: Select all
// ferase('library.dbf')
aSTRUCT := { {"TRACKNUM","N",4,0 }, ;
{"ALBUM_NO","C",6,0}, ;
{"ALBUM_TITL","C",40,0}, ;
{"TITLE","C",33,0}, ;
{"ARTIST","C",40,0}, ;
{"ART_NO","N",4,0}, ;
{"TRACK","N",2,0}, ;
{"DUR","C",5,0}, ;
{"YR","C",2,0}, ;
{"FILENAME","C",8,0} }
dbCreate("LIBRARY",aSTRUCT)
USE Library NEW
msginfo(alias())
dbGoBottom()
Serge
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 5:50 pm
by mol
Dbf file names are not delimited to 8 characters now
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 8:22 pm
by serge_girard
No, but fieldnames? I think:problem when reading...
Serge
Re: "Workarea not in use" Error
Posted: Thu Mar 29, 2018 8:49 pm
by mol
Fieldnames are delimited to 10 chars
