|
Post by votan on Apr 6, 2009 9:26:23 GMT -5
Ok... so I'm now experimenting with the run command and am running into some problems that always mess up my layout etc... The content does not show up as expected.... problem #1 the extra linebreak after "case 1:" causing an empty line. problem #2 case 2 shows the text in the wrong order.. the result of the runned function gets displayed at the beginning of the line and not where it is normally expected. Case 3 just shows, that it can be displayed in the right order.. but not in one line..... This is really driving me nutts.. trying all day long already to ge that solved. here is an example.... I just made it up for showing the problems... Just create a project called runtest and place the two files in that folder.. here is the parent program "runtest.bas"
and here is the child program "runtestchild.bas"
and this is the output:
|
|
|
Post by Carl Gundel - admin on Apr 6, 2009 10:04:27 GMT -5
That's an interesting glitch. Let me look into it.
I wouldn't recommend that you use RUN every time you need to use your other program unless you are trying to wipe out its state every time. RUN forces a recompile of the code each time it is used. Instead try it like so:
'at the beginning of your program global #child run "mychild.bas", #child
Then in your functions that use the child program:
#child test("some value")
-Carl
|
|
|
Post by kokenge on Apr 6, 2009 15:39:05 GMT -5
Votan, Keep us posted on you Run Progress if you don't mind.
I've been using the RUN command since day one. Basically there is no other option if you have a large system. I working on a manufacturing system for wine management. The database has over 100 files, and so far there is about 500 programs. Everything runs from a menu with user security on what they can run. So each thing they do is done with the RUN command. I like the fact that it runs in it's own sand box. It's especially nice for parent child like order entry with a child list of what they ordered. And sometimes you have more than one child. That's a little tricky. The big problem is that everything has to be controlled by the parent. Would be nice if you could direct the parent to do things based on what they do in the child. But not a big problem.. Overall it works great
Just my humble opinion..
|
|
|
Post by votan on Apr 6, 2009 16:59:26 GMT -5
I'm slowly starting to understand the full potential of the run command! This is getting better and better! So to make things easy to understand for noobs like me, let me summarize. If I run a child app at the beginning of a parent program, the child program will stay in memory for as long as the parent program is running... so I do not have to run the child anytime I need to access a function within the child!? Same goes for variables send to the child.... they will be present to the child as long as the parent is running and can be reused anytime during this time!? This is amazing! Kokenge.... Well, I guess I gonna use run completely different than you are doing it.... I only use it to modify variables from the parent and pass them back to the parent or to do sql queries and pass results or error messages back to the parent. But it's kind of interesting to use run to actually call dependent sub-programs that appear as seperate apps.... But then it should also be possible to pass any activities performed by a user in those sub-programs back to the parent and use those informations by the parent!?
|
|
|
Post by Psycho on Apr 6, 2009 21:34:13 GMT -5
Votan, Keep us posted on you Run Progress if you don't mind. votan, I too would like to hear your progress on use of the run command. I am also fairly new to it's use so I can appreciate the questions you've posed. I began experimenting with it about three months ago at the same time I began trying to learn the SQLite database functions. I had also read all the posts about the run command and it seemed most of the early usage leaned towards using it basically as external functions so the programs could be saved a single time and called from multiple programs. Since I was getting used to SQLite at the same time, I actually wrote separate programs that could actually run as standalone if so desired. As it happened for me, the program I started with had three main sections, all calling on the same database. I wrote the first part as you normally would in RB but when I got to the second section, I had the main program call it with the run command. I was able to leave links on screen from the parent program, write and modify the code for the child using my Liberty Basic editor, then each time I saved a change, A simple click of the live link in the parent program would run the new version which made troubleshooting the subsequent portions so much easier. I don't know if there is a "textbook" way to use it but if there is, I'm probably not doing. Either way, it is an interesting function and very powerful as you begin to learn the many ways it can be utilized. Good luck with it! John "Psycho" Siejkowski
|
|
|
Post by votan on Apr 7, 2009 6:27:54 GMT -5
Thanx... I guess I'll need it. But all this brings me to another question... I know, I could just try it.... but I'm not at my home system right now... so maybe someone here can already tell?? After I initially run the child app, can the child also call functions that are in the parent app??.. or can the child only access functions within itself or another child of the child? That would make interactions between parents and childs pretty easy...
|
|
|
Post by kokenge on Apr 7, 2009 8:10:24 GMT -5
One other thing you may want to consider. According to Carl, the next release of RB will have something like the "include" statement. So, I've kind of been waiting for that. The combination of these two features should take care of some of the stuff you are talking about? BTW.. If you want to see one of my first projects I wrote using the RUN command you can download a calendar system I wrote. Very simple - has only about 5 tables and about 5 programs all glued together using the RUN command. you can download it here: www.dkokenge.com/rbp/ftp/calendar.zipuse admin/admin as user/pass Dan.
|
|