Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very Strange Tcursor error

Status
Not open for further replies.

jerrygordon

Programmer
Oct 2, 2008
2
US

I'm in the process of tracking down a very odd runtime error. I have a client that has been using a custom software package (built in Paradox 9) for eight years without a hitch. Recently, they've been experiencing difficulties (problem and code below)

The runtime software works when loaded, when the machine is restarted, and when it is cold booted. If they leave the machine on for days, the software works. But, if they shut the machine down on one day and restart it on a subsequent day, they get the following error message:

An error was triggered in the 'copy to array' method on an object of T cursor time.

The error corresponds to a small bit of code that opens a table for program setting information and copies it to an array, but I can't imagine what could be interfering.

Here's the code in question:

var
netArray Array [2] Anytype
tc Tcursor
endVar

self.visible = NOT(self.visible)
if status="0%" then
setMouseShapeFromFile("globe.ani")
status="3%"
play("copy.sdl")
tc.open("Variablenet.db")
tc.copyToArray(netArray)

netError = netArray[2]
if netError = 1 then close() else
status="10%"
play("convert2.sdl")
status="50%"
play("process.sdl")
status="95%"
sleep(1000)
status="100%"
sleep(1000)
close()
endIF
endIF

Reloading the software fixes the problem (until they turn the computer off overnight). If you have any thoughts or experience with this type of error, I would greatly appreciate a second opinion.

Also, on the chance that I'm missing the forest for the trees, please point out the obvious error.

Thanks in advance.
 

First, that error is actually

An error was triggered in the 'copytoarray' method on an object of tCursor type.

Does the error dialogue have a '>>' button? Click on it, and you may get further information on the error. Keep reading each screen, and click on the '>>' to view more error info as long as you get another '>>'.


Next, how about trying to trap for error on open?

Code:
if not tc.open(("Variablenet.db") then
  errorshow("error on open")
  return
endif


if not tc.copyToArray(netArray) then
  errorshow("error on copytoarray")
  return
endif

You may want to check the network card setting; if 'allow OS to put this device to sleep' is checked, uncheck it.

Same with the hard drive, if your system allows it to be unchecked.

Last, there are some 'play' statements in there. Are you CERTAIN the snippet of code is where the error is happening?

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
I tried trapping the error and got no new information, just the original message: "An error was triggered in the 'copytoarray' method on an object of tCursor type."

The onscreen status reads "3%" at the point of error. It would need to read 10% before any of the play statements came into the mix.

The most perplexing aspect of this problem is that it can't be duplicated on a test server (with or without development software). The onsite client has a problem that seems specific to their office.
 

Well, 'copy.sdl' is AFTER the 3% assignment; what is in there? (Note that it is copy.sdl, so it wouldn't be copy.ssl that would fire even in development environment.)

Oh, Oh!

Did we (I missed it too) forget to do tc.edit() and did you not click on the '>>' for the rest of the story?



Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
The code is where? sometimes a form corrupts the code and causes a GPE or the like.

Try renaming and recreating the code, if on a form save the old one, then save as a new one but cutting out the code. Then re-paste the code in and re-save as the oringinal name.

But it worked with a similar problem I had recently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top