revDataGridLibrary in standalone with Valentina4 DB Support
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
revDataGridLibrary in standalone with Valentina4 DB Support
I have a livecode::Valentina DB combination that contains datagrids in the main stack and associated substacks.
I need to include the revDataGridLibrary in the standalone application for the standalone
to function correctly. In the standalone application settings I have chosen the "select inclusions
for standalone application settings" since I have to add database support for Valentina4.
Therefore, the system does not automically search for the revDataGridLibrary when I build a
standalone app. Is there a way to add the revDataGridLibrary stack as a substack in my mainstack?
Thanks,
Jorge
I need to include the revDataGridLibrary in the standalone application for the standalone
to function correctly. In the standalone application settings I have chosen the "select inclusions
for standalone application settings" since I have to add database support for Valentina4.
Therefore, the system does not automically search for the revDataGridLibrary when I build a
standalone app. Is there a way to add the revDataGridLibrary stack as a substack in my mainstack?
Thanks,
Jorge
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Never mind. I found the revDataGridLibrary in the IDE and added it manually as a substack.
The datagrid tables are working in my standalone APP. These types of resources were easier to locate
in the prior versions of Runtime Rev.
Jorge
The datagrid tables are working in my standalone APP. These types of resources were easier to locate
in the prior versions of Runtime Rev.
Jorge
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
I have the exact same question and would like to cancel JLGDBMD's "never mind":
I need to include the revDataGridLibrary in the standalone, but I'm already doing the "Select inclusions for the standalone application" option because I also need the Database library and Database Support (ODBC), so these tutorial instructions http://lessons.runrev.com/s/lessons/m/d ... -data-grid won't work. (Not sure how to use that URL button for this post, either, but that's another story.)
I Googled and found some antiquated instructions that don't correspond to what I find in the current Standalone Settings. I managed to add the library file as a stack or maybe substack for the standalone--at least it's there after I build the standalone, but I'm not at all convinced I've done it right. My data grid doesn't work in the standalone yet, but that could be lots of other causes.
Anyone have the instructions? Why doesn't revDataGridLibrary appear in the list of Script Libraries in the Standalone Settings?
I need to include the revDataGridLibrary in the standalone, but I'm already doing the "Select inclusions for the standalone application" option because I also need the Database library and Database Support (ODBC), so these tutorial instructions http://lessons.runrev.com/s/lessons/m/d ... -data-grid won't work. (Not sure how to use that URL button for this post, either, but that's another story.)
I Googled and found some antiquated instructions that don't correspond to what I find in the current Standalone Settings. I managed to add the library file as a stack or maybe substack for the standalone--at least it's there after I build the standalone, but I'm not at all convinced I've done it right. My data grid doesn't work in the standalone yet, but that could be lots of other causes.
Anyone have the instructions? Why doesn't revDataGridLibrary appear in the list of Script Libraries in the Standalone Settings?
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Hi friends,
The easiest way to force Livecode to add the DG lib to your standalone is to add a datagrid to your mainstack
(the one that gets turend into a standalone) and hide the empty datagrid.
Best
Klaus
I don't have the slightest ideastephenmcnutt wrote:Why doesn't revDataGridLibrary appear in the list of Script Libraries in the Standalone Settings?

The easiest way to force Livecode to add the DG lib to your standalone is to add a datagrid to your mainstack
(the one that gets turend into a standalone) and hide the empty datagrid.

Best
Klaus
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
I don't think that'll work in my situation, Klaus, which is the same situation as the original post by JLGDBMD: The tutorial instructions (linked in my earlier post) seem to indicate that IF you select Standalone Application Settings --> General tab --> Inclusions --> "Search for required inclusions when saving the standalone application", THEN, well... it'll do just that.
BUT if you instead select Inclusions --> Advanced Options --> "Select inclusions for the standalone application", THEN it WON'T automatically try to figure out what you need for the standalone. I have this second "Select inclusions..." option selected because in addition to the dataGrid library, I also need to select, under "Select inclusions...", Script Libraries --> Database and Database Support --> ODBC. In fact, I DO have a dataGrid in my mainstack.
Is that about as clear as mud?
.
Regardless of whether what I said above is correct, how do I tell whether the library HAS been included after building the standalone? Should I be able to see the revDataGridLibrary.rev folder somewhere in the folder (Windows) or package (Mac)?
And let me just say thank you very, very much, Klaus, for all the help you've given me for many years now. Seriously. Thank you.
BUT if you instead select Inclusions --> Advanced Options --> "Select inclusions for the standalone application", THEN it WON'T automatically try to figure out what you need for the standalone. I have this second "Select inclusions..." option selected because in addition to the dataGrid library, I also need to select, under "Select inclusions...", Script Libraries --> Database and Database Support --> ODBC. In fact, I DO have a dataGrid in my mainstack.
Is that about as clear as mud?

Regardless of whether what I said above is correct, how do I tell whether the library HAS been included after building the standalone? Should I be able to see the revDataGridLibrary.rev folder somewhere in the folder (Windows) or package (Mac)?
And let me just say thank you very, very much, Klaus, for all the help you've given me for many years now. Seriously. Thank you.
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Hi Stephen,
au contraire, mon ami!
I just made a little stack with one datagrid, selected "Advanced Options --> "Select inclusions for the standalone application",
left the default settings, created a standalone and the datagrid just worked!
I NEVER use any of the automatisms of LC!
Actually the standalone builder checks if there is a substack named "Data Grid Templates XXXXXXXXX".
If it is there, then the datagrid library will be added.
Unfortuatley RunRev does not tell exactly how the LC libs are attached to the standalone,
but I think they are NOT added as substacks or separate stacks files, but LC creates a new invisible GROUP
on the first card of the standalone, copies all neccessary scripts from hjte LC libs to the script of that group
and inserts this script into front or back.
But this all happens in the process of building the standalone, so you have no visual hint in the actual stack.
Best
Klaus
au contraire, mon ami!

I just made a little stack with one datagrid, selected "Advanced Options --> "Select inclusions for the standalone application",
left the default settings, created a standalone and the datagrid just worked!
I NEVER use any of the automatisms of LC!

Actually the standalone builder checks if there is a substack named "Data Grid Templates XXXXXXXXX".
If it is there, then the datagrid library will be added.
Unfortuatley RunRev does not tell exactly how the LC libs are attached to the standalone,
but I think they are NOT added as substacks or separate stacks files, but LC creates a new invisible GROUP
on the first card of the standalone, copies all neccessary scripts from hjte LC libs to the script of that group
and inserts this script into front or back.
But this all happens in the process of building the standalone, so you have no visual hint in the actual stack.
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Well, I think I'm wrong about needing to manually select the other database stuff as I described in my last post. I decided to try just using the "Search for required inclusions when saving the standalone application" option, and it seems to have included all the database stuff I need--more files than before, so maybe there are some unnecessary files, but I'm still able to access data from the Microsoft Outlook database in the standalone.
Here are the files in the Windows standalone folder: \Externals\revdb.dll and \Externals\database_drivers\dbmysql.dll, dbodbc.dll, dboracle.dll, dbpostgresql.dll, and dbsqlite.dll.
I don't see anything in there about dataGrids, though.
If the required dataGrid library IS included in the above listed files, then my dataGrid "Display Data" button just isn't working. Here's the script, which I modified from the tutorial "Converting a Database Cursor to a DataGrid Array" (http://lessons.runrev.com/s/lessons/m/d ... grid-array) for use with my Microsoft Access database. Maybe I modified incorrectly.
Here's the script. The part about opening a database connection and getting the connection ID works when I'm just trying to put the data into a regular field. (NOTE: I don't know whether this works in the IDE because unfortunately I only have the IDE for Mac, and the program I'm writing is for Windows, so I have to create the standalone to test things. If I could create a database reference using the Windows ODBC Data Source Administrator that includes a file path from my Mac to the PC, which is connected by network, then maybe I could test in the IDE, but I don't know that this is possible.)
on mouseUp
get revOpenDatabase ("ODBC","StevesSCIR", , , )
put it into connectionID
if connectionID is an integer then
put revQueryDatabase(connectionID,"SELECT * FROM Table1") into theCursor
if theCursor is an integer then
ConvertDBCursorToArray theCursor, theDataGridArray
put the result into theError
if theError is empty then
set the dgData of group "Data Grid 1" to theDataGridArray
end if
revCloseCursor theCursor
end if
revCloseDatabase connectionID
else
answer "Error connecting to the database. Returned connectionID: " & connectionID
end if
end mouseUp
on convertDBCursorToArray pCursor, pOutArrayA
local i
local theFields
local theError
put revDatabaseColumnNames(pCursor) into theFields
if theFields begins with "revdberr," then
put item 2 to -1 of theFields into theError
end if
if theError is empty then
put 0 into i
repeat until revQueryIsAtEnd(pCursor)
add 1 to i
repeat for each item theField in theFields
put revDatabaseColumnNamed(pCursor, theField) into pOutArrayA[theField]
end repeat
revMoveToNextRecord pCursor
end repeat
end if
return theError
end convertDBCursorToArray
Here are the files in the Windows standalone folder: \Externals\revdb.dll and \Externals\database_drivers\dbmysql.dll, dbodbc.dll, dboracle.dll, dbpostgresql.dll, and dbsqlite.dll.
I don't see anything in there about dataGrids, though.
If the required dataGrid library IS included in the above listed files, then my dataGrid "Display Data" button just isn't working. Here's the script, which I modified from the tutorial "Converting a Database Cursor to a DataGrid Array" (http://lessons.runrev.com/s/lessons/m/d ... grid-array) for use with my Microsoft Access database. Maybe I modified incorrectly.
Here's the script. The part about opening a database connection and getting the connection ID works when I'm just trying to put the data into a regular field. (NOTE: I don't know whether this works in the IDE because unfortunately I only have the IDE for Mac, and the program I'm writing is for Windows, so I have to create the standalone to test things. If I could create a database reference using the Windows ODBC Data Source Administrator that includes a file path from my Mac to the PC, which is connected by network, then maybe I could test in the IDE, but I don't know that this is possible.)
on mouseUp
get revOpenDatabase ("ODBC","StevesSCIR", , , )
put it into connectionID
if connectionID is an integer then
put revQueryDatabase(connectionID,"SELECT * FROM Table1") into theCursor
if theCursor is an integer then
ConvertDBCursorToArray theCursor, theDataGridArray
put the result into theError
if theError is empty then
set the dgData of group "Data Grid 1" to theDataGridArray
end if
revCloseCursor theCursor
end if
revCloseDatabase connectionID
else
answer "Error connecting to the database. Returned connectionID: " & connectionID
end if
end mouseUp
on convertDBCursorToArray pCursor, pOutArrayA
local i
local theFields
local theError
put revDatabaseColumnNames(pCursor) into theFields
if theFields begins with "revdberr," then
put item 2 to -1 of theFields into theError
end if
if theError is empty then
put 0 into i
repeat until revQueryIsAtEnd(pCursor)
add 1 to i
repeat for each item theField in theFields
put revDatabaseColumnNamed(pCursor, theField) into pOutArrayA[theField]
end repeat
revMoveToNextRecord pCursor
end repeat
end if
return theError
end convertDBCursorToArray
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Hi AStepehen,
as I tried to explain, not all Rev Libraries are DLLs!
Some of them are just stacks like the "revdatagridlibrary.rev" with its >3000 lines of code.
That code will be copied to the group on the first card, see my last post.
To your DB problem, you are just missing a little char -> @
## Bad:
on convertDBCursorToArray pCursor, pOutArrayA
## Good:
on convertDBCursorToArray pCursor, @pOutArrayA
With the @ in front the handler will not return the completely filled variable, but fills it right at the PHYSICAL ADDRESS IN MEMORY of that variable,
some kind of "home delivery" so to say, which makes sense with large amounts of data.
Best
Klaus
as I tried to explain, not all Rev Libraries are DLLs!
Some of them are just stacks like the "revdatagridlibrary.rev" with its >3000 lines of code.
That code will be copied to the group on the first card, see my last post.
To your DB problem, you are just missing a little char -> @

## Bad:
on convertDBCursorToArray pCursor, pOutArrayA
## Good:
on convertDBCursorToArray pCursor, @pOutArrayA
With the @ in front the handler will not return the completely filled variable, but fills it right at the PHYSICAL ADDRESS IN MEMORY of that variable,
some kind of "home delivery" so to say, which makes sense with large amounts of data.

Best
Klaus
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Well some good news: I was ALSO wrong about not having the license to run the IDE on Windows, too. I just downloaded it. That should make my Windows development quite a bit easier!
I deleted that @ because it looked like a typo: Later in the script there's this:
put revDatabaseColumnNamed(pCursor, theField) into pOutArrayA[theField]
And in that case, there is no @. That's what I get for knowing nothing about what I'm doing. This is my first foray into both databases (with LC) and dataGrid, so I'm thrashing blindly at the moment.
Thanks again for all your excellent help, Klaus.
I deleted that @ because it looked like a typo: Later in the script there's this:
put revDatabaseColumnNamed(pCursor, theField) into pOutArrayA[theField]
And in that case, there is no @. That's what I get for knowing nothing about what I'm doing. This is my first foray into both databases (with LC) and dataGrid, so I'm thrashing blindly at the moment.
Thanks again for all your excellent help, Klaus.
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Hi Stephen,
Yep, at that time the variable had already been filled.
Could be worse and raining...
Oh, wait it IS raining
My pleasure!
Best from germany
Klaus
Yep, you can install LC on all of your dev machines, as longs as you aren't using them at the same timestephenmcnutt wrote:Well some good news: I was ALSO wrong about not having the license to run the IDE on Windows, too. I just downloaded it. That should make my Windows development quite a bit easier!

Ouch!stephenmcnutt wrote:I deleted that @ because it looked like a typo

stephenmcnutt wrote:I deleted that @ because it looked like a typo: Later in the script there's this:
put revDatabaseColumnNamed(pCursor, theField) into pOutArrayA[theField]
And in that case, there is no @.
Yep, at that time the variable had already been filled.
stephenmcnutt wrote:That's what I get for knowing nothing about what I'm doing. This is my first foray into both databases (with LC) and dataGrid, so I'm thrashing blindly at the moment.
Could be worse and raining...
Oh, wait it IS raining

stephenmcnutt wrote:Thanks again for all your excellent help, Klaus.
My pleasure!
Best from germany
Klaus
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
I finally got the DataGrid working in the Windows IDE. The last hurdle: The DataGrid font size was set to something giant, so I wasn't seeing anything! It's always something.
One last question (for the day): I just copied my Mac IDE file over to my PC. Is that bad? Should I create from scratch on the PC? One weird thing is happening: When I double-click in the Application Browser, which I have set to show the script, for some controls I get a blank script, and the tab says field "TimeOut 0002". If I right-click the control on the card, I can see the real script that way.
One last question (for the day): I just copied my Mac IDE file over to my PC. Is that bad? Should I create from scratch on the PC? One weird thing is happening: When I double-click in the Application Browser, which I have set to show the script, for some controls I get a blank script, and the tab says field "TimeOut 0002". If I right-click the control on the card, I can see the real script that way.
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
Hi Stephen,
Sorry, couldn't resist...
No, except some eventual font issues there are no problems with copying stacks between Mac and Windows.
Best
Klaus
Yep, that's called "life"stephenmcnutt wrote:I finally got the DataGrid working in the Windows IDE. The last hurdle: The DataGrid font size was set to something giant, so I wasn't seeing anything! It's always something.

Nope, that's called crossplatform development!stephenmcnutt wrote:One last question (for the day): I just copied my Mac IDE file over to my PC. Is that bad? Should I create from scratch on the PC?

Sorry, couldn't resist...
No, except some eventual font issues there are no problems with copying stacks between Mac and Windows.
??? Are you talking about a DataGrid in the Application Browser?stephenmcnutt wrote:One weird thing is happening: When I double-click in the Application Browser, which I have set to show the script, for some controls I get a blank script, and the tab says field "TimeOut 0002". If I right-click the control on the card, I can see the real script that way.
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: revDataGridLibrary in standalone with Valentina4 DB Supp
No. It's a button that does that. It didn't do it before I moved it from the Mac to the PC. Another weird thing happened at first: I couldn't select the controls on the card with the browse tool. I quit and reopened, and that started working. Maybe this other thing will go away, too.