RevQueryDatabase error in standalone

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

RevQueryDatabase error in standalone

dunbarx via use-livecode
Hi all.

In dev mode I create a memory database, populate it, query it everythign works fine. In a standalone however, the app throws an error when I call revQueryDatabase. I have verified all the inclusions are included for sqLite and database operations. Any known issues? sqlYoga works fine with a mySQL database, and it has to be using the Database API too, so it has to be an issue with using a memory based database in a standalone.

Bob S
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
whats the error? ... i use sqlite with standalones as files and in memory
..without problems.

On Wed, Jan 24, 2018 at 7:58 PM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Hi all.
>
> In dev mode I create a memory database, populate it, query it everythign
> works fine. In a standalone however, the app throws an error when I call
> revQueryDatabase. I have verified all the inclusions are included for
> sqLite and database operations. Any known issues? sqlYoga works fine with a
> mySQL database, and it has to be using the Database API too, so it has to
> be an issue with using a memory based database in a standalone.
>
> Bob S
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Unfortunately, the error comes from the standalone CTD dialog, and it only provides the command that failed. I verified that it was in fact that command by putting an answer dialog just before and just after the query command. I got the first but not the second answer dialog.

I can put the command inside a try/catch and see what I get.

Bob S

> On Jan 25, 2018, at 12:29 , Tom Glod via use-livecode <[hidden email]> wrote:
>
> whats the error? ... i use sqlite with standalones as files and in memory
> ..without problems.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
ya you have to look at the error.....sometimes its not what you'd expect
expect.

On Thu, Jan 25, 2018 at 6:28 PM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Unfortunately, the error comes from the standalone CTD dialog, and it only
> provides the command that failed. I verified that it was in fact that
> command by putting an answer dialog just before and just after the query
> command. I got the first but not the second answer dialog.
>
> I can put the command inside a try/catch and see what I get.
>
> Bob S
>
> > On Jan 25, 2018, at 12:29 , Tom Glod via use-livecode <
> [hidden email]> wrote:
> >
> > whats the error? ... i use sqlite with standalones as files and in memory
> > ..without problems.
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Hi all.

Now I'm not even getting to the revOpenDatabase call. Mind you this ONLY happens when I run the standalone. Not in the IDE. This is what I get when I send an email from the crash dialog:

Executing at 3:40:49 PM on Monday, January 29, 2018
Type: Object: card id 1002 of stack '//Mac/Home/Documents/Livecode Projects/Forms Generator 8/Forms Generator/Forms Generator.exe'
Error: 361,0,0
241,10,1,openStack
353,0,0,card id 1002 of stack '//Mac/Home/Documents/Livecode Projects/Forms Generator 8/Forms Generator/Forms Generator.exe'

The card script has a total of 261 lines of code. 241 is a comment. Not sure this is at all a helpful error report.

Bob S

 
> On Jan 25, 2018, at 17:06 , Tom Glod via use-livecode <[hidden email]> wrote:
>
> ya you have to look at the error.....sometimes its not what you'd expect
> expect.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
On 01/29/2018 03:48 PM, Bob Sneidar via use-livecode wrote:

> Hi all.
>
> Now I'm not even getting to the revOpenDatabase call. Mind you this ONLY happens when I run the standalone. Not in the IDE. This is what I get when I send an email from the crash dialog:
>
> Executing at 3:40:49 PM on Monday, January 29, 2018
> Type: Object: card id 1002 of stack '//Mac/Home/Documents/Livecode Projects/Forms Generator 8/Forms Generator/Forms Generator.exe'
> Error: 361,0,0
> 241,10,1,openStack
> 353,0,0,card id 1002 of stack '//Mac/Home/Documents/Livecode Projects/Forms Generator 8/Forms Generator/Forms Generator.exe'
>
> The card script has a total of 261 lines of code. 241 is a comment. Not sure this is at all a helpful error report.

I don't have the context for this anymore but...
um...
you're trying to run a exe file on a Mac?

Aside from that, runtime error 361 is "Object: can't set that property"
and your error is at line 10 in the openStack handler.

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Yeah that particular error came from having moved on recommendation, my preOpenStack and openStack handlers to the card script of my Login stack. Once I moved them back this particular error disappeared. Now I am getting invalid database id when I attempt to query the database. I will check the result after revOpenDatabase. Odd thing is it works perfectly in dev mode but not as a standalone, and other database functions work fine. It's just when I attempt to open a memory database.

Bob S


> On Jan 29, 2018, at 17:21 , Mark Wieder via use-livecode <[hidden email]> wrote:
>
> I don't have the context for this anymore but...
> um...
> you're trying to run a exe file on a Mac?
>
> Aside from that, runtime error 361 is "Object: can't set that property"
> and your error is at line 10 in the openStack handler.
>
> --
> Mark Wieder
> [hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Bob,

is it possible that you have SaveStackRequest handler in one of your stacks or cards  and forgot to add 'pass savestackrequest' as the last line to it?

I remember  that i once had a similar problem  and in my case i had forgotten to add that line.
The result was i could save the standalone and although the db externals were included into it i was not able to do any database communication.

Just a thought….

Regards,
Matthias


> Am 30.01.2018 um 16:14 schrieb Bob Sneidar via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> Yeah that particular error came from having moved on recommendation, my preOpenStack and openStack handlers to the card script of my Login stack. Once I moved them back this particular error disappeared. Now I am getting invalid database id when I attempt to query the database. I will check the result after revOpenDatabase. Odd thing is it works perfectly in dev mode but not as a standalone, and other database functions work fine. It's just when I attempt to open a memory database.
>
> Bob S
>
>
>> On Jan 29, 2018, at 17:21 , Mark Wieder via use-livecode <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> I don't have the context for this anymore but...
>> um...
>> you're trying to run a exe file on a Mac?
>>
>> Aside from that, runtime error 361 is "Object: can't set that property"
>> and your error is at line 10 in the openStack handler.
>>
>> --
>> Mark Wieder
>> [hidden email] <mailto:[hidden email]>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Thanks Matthias. I did a search on the main stack and substacks and got no hits. Good to know though.

Bob S


> On Jan 30, 2018, at 07:30 , Matthias Rebbe via use-livecode <[hidden email]> wrote:
>
> Bob,
>
> is it possible that you have SaveStackRequest handler in one of your stacks or cards  and forgot to add 'pass savestackrequest' as the last line to it?
>
> I remember  that i once had a similar problem  and in my case i had forgotten to add that line.
> The result was i could save the standalone and although the db externals were included into it i was not able to do any database communication.
>
> Just a thought….
>
> Regards,
> Matthias

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Okay I found the issue with the standalone not building properly. I wrote a new handler to size a window based on the min/max left, top,right,bottoms of every visible object, so that the "air" or empty space is consistent for every stack opened. It *sorta* works, as long as the topmost and leftmost of the most extreme top left objects are where you want them to be. But that is neither here nor there.

To do this more easily, I gather the rects of every object, along with a few other properties into an array, then convert the array to a memory database, where I can query it for the rect,visible and owner properties, excluding simple groups (not datagrids) and the menu group. The result is a text variable containing these properties of every object on a card that I queried for, and I can sort the lines by item 2,3,4 or 5 of each to get the min left and top, and the max right and bottom of all the objects. Good so far?

All that works a peach in development mode. But in a standalone, something fails when the app launches AS A STANDALONE. If I open the mainstack in the standalone folder in the IDE, it ALSO runs fine, so it isn't that something is going wrong in the build process!!! Just not as a STANDALONE!

Here is the code. After commenting out all the calls to this handler, the standalone works fine again. I am completely befuddled by this. If anyone can find fault in this code, which would ONLY cause a problem with a standalone, I'd love to hear it:

on setWindowRect pCardID
   lock screen
   put the short name of pCardID into tCardName
   if not there is a card tCardName then return "ERROR: No Card ID supplied."
   put getParentStack(pCardID) into pStackID
   put the left of pStackID into tOldLeft
   put the top of pStackID into tOldTop
   put tOldLeft into item 1 of tOldTopLeft
   put tOldTop into item 2 of tOldTopLeft
   put the loc of pStackID into tOldLoc
   put "rect,visible,owner" into tPropList
   put getCardObjects(pCardID, tPropList) into aCardObjects
   put aCardObjects ["props"] into aObjectProperties
   put arrayToMemoryDB(aObjectProperties) into tDBID
   put "select * from arraydata where" into tQuery
   put " visible = 'true'" after tQuery
   put " AND (NOT controlname LIKE 'group " & quote & "grp%" & quote & "')" after tQuery
   put " AND (NOT controlname LIKE '%MainMenu%')" after tQuery
   put " AND (NOT owner LIKE  '%MainMenu%')" after tQuery
   if the environment is not "Development" then answer "about to query memory database."
   
   try
      put revDataFromQuery(comma,cr,tDBID,tQuery) into tQueryResults
   catch theError
      answer theError
   end try
   
   revCloseDatabase tDBID
   if the environment is not "Development" then answer "just queried memory database."
   sort tQueryResults numeric by item 2 of each
   put item 2 of line 1 of tQueryResults into minLeft
   sort tQueryResults numeric by item 3 of each
   put item 3 of line 1 of tQueryResults into minTop
   sort tQueryResults numeric descending by item 4 of each
   put item 4 of line 1 of tQueryResults into maxRight
   sort tQueryResults numeric descending by item 5 of each
   put item 5 of line 1 of tQueryResults into maxBottom
   subtract 26 from maxBottom -- Title Bar Height
   -- if the platform contains "MAC" then subtract 21 from maxBottom -- for menubar
   -- if the platform contains "WIN" then add 21 to maxBottom
   put minLeft + tOldLeft -30 into item 1 of tNewRect
   put minTop + tOldTop -45 into item 2 of tNewRect
   put maxRight + tOldLeft + minLeft into item 3 of tNewRect
   put maxBottom + tOldTop into item 4 of tNewRect
   set the rect of pStackID to tNewRect
   if the platform contains "WIN" then set the height of pStackID to the height of pStackID +21
   set the topLeft of pStackID to tOldTopLeft
   
   put the effective working screenrect into tScreenRect
   put rectWithin(tNewRect, tScreenRect) into tIsWithin
   
   if not tIsWithin then
      set the loc of pStackID to the screenLoc -- center window
   end if
   unlock screen
end setWindowRect


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
On 02/02/2018 09:37 AM, Bob Sneidar via use-livecode wrote:
>     put the short name of pCardID into tCardName

I don't think you can do that.
Shouldn't that be "card id pCardID"?

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
pCardID contains the long ID of the card that called it. Remember it works perfectly in the IDE, so it's doubtful there are any syntactical errors. I am vaguely remembering that there are times when openCard is triggered first and openstack at other times. If openCard gets triggered first when opening the mainstack, none of the libraries (like the utilities backscript containing virtually EVERYTHING that makes the stack work) will get loaded.

A while back I posted there was a difference between Windows and Mac as to when certain messages were sent first, but I think now it may actually be a difference between IDE and Standalone.

I will investigate further, now I know where to look.

Bob S


> On Feb 2, 2018, at 10:26 , Mark Wieder via use-livecode <[hidden email]> wrote:
>
> On 02/02/2018 09:37 AM, Bob Sneidar via use-livecode wrote:
>>    put the short name of pCardID into tCardName
>
> I don't think you can do that.
> Shouldn't that be "card id pCardID"?
>
> --
> Mark Wieder


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: RevQueryDatabase error in standalone

dunbarx via use-livecode
Belay that. Openstack happens first no matter what. I think at this point I will use it only as a utility for resizing windows when things have been rearranged, or a new form is created and I need to clean it up a bit.

Bob S


> On Feb 2, 2018, at 16:11 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> A while back I posted there was a difference between Windows and Mac as to when certain messages were sent first, but I think now it may actually be a difference between IDE and Standalone.
>
> I will investigate further, now I know where to look.
>
> Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode