send vs dispatch and continuously running processes
Just want to confirm I understand these commands. I tend to write applications that run continuously. They loop over and over doing the same tasks and pretty much never get to a point to where they halt waiting for user input. Thus for me the current script never finishes executing. The "send blah in X minutes" command appears to only execute once the current script has completed, which in my case is never. So I assume I should never use the "in X minutes" form and only ever use send as an immediate command such that the current script halts and waits for it to complete. Correct? Dispatch looks to me like send except it makes it easier to include parameters and does not include the delay, which I cannot use anyway. Correct? I was hoping that I could use Send or Dispatch to fire off a bunch of get URL commands and then circle back to gather their results, a form of threads or multi-tasking but from what I can see in the 4.5 docs, that is not how those functions work. Is there a way in LiveCode to spawn a bunch of processes to run in parallel and then to process their results as they get returned? I'm assuming the answers are: Yes, Yes, No. Just want to make sure I understand them. Kee Nethery___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
If you're doing something like a repeat forever loop, somewhere in the loop you should have a wait with messages command so the script has breathing room to execute other things. IE: wait 10 milliseconds with messages As for getting web urls, have you looked at the load command? it will load a page into cache in the background, and you can designate a callback to handle it when the load is done. Since this is a looping forever thing you'll need to make sure you unload the url after you process the results so that you always get a fresh result, and so that you don't fill your memory to the brim and bring your system to a standstill. On Thu, Sep 30, 2010 at 7:27 AM, Kee Nethery wrote: > Just want to confirm I understand these commands. > > I tend to write applications that run continuously. They loop over and over > doing the same tasks and pretty much never get to a point to where they halt > waiting for user input. Thus for me the current script never finishes > executing. > > The "send blah in X minutes" command appears to only execute once the > current script has completed, which in my case is never. So I assume I > should never use the "in X minutes" form and only ever use send as an > immediate command such that the current script halts and waits for it to > complete. Correct? > > Dispatch looks to me like send except it makes it easier to include > parameters and does not include the delay, which I cannot use anyway. > Correct? > > I was hoping that I could use Send or Dispatch to fire off a bunch of get > URL commands and then circle back to gather their results, a form of threads > or multi-tasking but from what I can see in the 4.5 docs, that is not how > those functions work. Is there a way in LiveCode to spawn a bunch of > processes to run in parallel and then to process their results as they get > returned? > > I'm assuming the answers are: Yes, Yes, No. Just want to make sure I > understand them. > > Kee Nethery___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution > ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
Will look at load and callback as a way to implement this kind of multitasking, thanks. Kee On Sep 30, 2010, at 6:42 AM, Mike Bonner wrote: > If you're doing something like a repeat forever loop, somewhere in the loop > you should have a wait with messages command so the script has breathing > room to execute other things. > IE: > wait 10 milliseconds with messages > > As for getting web urls, have you looked at the load command? > > it will load a page into cache in the background, and you can designate a > callback to handle it when the load is done. Since this is a looping > forever thing you'll need to make sure you unload the url after you process > the results so that you always get a fresh result, and so that you don't > fill your memory to the brim and bring your system to a standstill. > > On Thu, Sep 30, 2010 at 7:27 AM, Kee Nethery wrote: > >> Just want to confirm I understand these commands. >> >> I tend to write applications that run continuously. They loop over and over >> doing the same tasks and pretty much never get to a point to where they halt >> waiting for user input. Thus for me the current script never finishes >> executing. >> >> The "send blah in X minutes" command appears to only execute once the >> current script has completed, which in my case is never. So I assume I >> should never use the "in X minutes" form and only ever use send as an >> immediate command such that the current script halts and waits for it to >> complete. Correct? >> >> Dispatch looks to me like send except it makes it easier to include >> parameters and does not include the delay, which I cannot use anyway. >> Correct? >> >> I was hoping that I could use Send or Dispatch to fire off a bunch of get >> URL commands and then circle back to gather their results, a form of threads >> or multi-tasking but from what I can see in the 4.5 docs, that is not how >> those functions work. Is there a way in LiveCode to spawn a bunch of >> processes to run in parallel and then to process their results as they get >> returned? >> >> I'm assuming the answers are: Yes, Yes, No. Just want to make sure I >> understand them. >> >> Kee Nethery___ >> use-revolution mailing list >> use-revolution@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-revolution >> > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution - I check email roughly 2 to 3 times per day. Kagi main office: +1 (510) 550-1336 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
I don't really know what you intend, but you probably do not want to lock yourself into a repeat loop. As others have suggested, "send in time with messages" is very effective, and then call that again: on myMessage doYourStuff send myMessage to me in 1 miilisecond with messages end myMessage Or someSuch. Craig Newman ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
If you DO use a repeat loop, the 'wait with messages' is pretty much obligatory right? So you can setup an exit strategy and so that pending messages (such as sends and dispatches) will still be processed, right? On Thu, Sep 30, 2010 at 8:11 AM, wrote: > I don't really know what you intend, but you probably do not want to lock > yourself into a repeat loop. As others have suggested, "send in time with > messages" is very effective, and then call that again: > > on myMessage > > doYourStuff > > send myMessage to me in 1 miilisecond with messages > > end myMessage > > Or someSuch. > > Craig Newman > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution > ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
Obligatory. Otherwise there is no vehicle for any other interaction. This was the basis for last week's thread, where it was discussed how to dig into a running process from outside that process. You cannot. Fortunately, in this case the "wait" command is within the operating handler, and control can be delegated, and acquired, as needed. Craig Newman In a message dated 9/30/10 10:15:49 AM, bonnm...@gmail.com writes: > If you DO use a repeat loop, the 'wait with messages' is pretty > much > obligatory right? So you can setup an exit strategy and so that pending > messages (such as sends and dispatches) will still be processed, right? > ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
This seems like a good pattern for an app driven by a human. The apps I tend to write launch and then run forever. They constantly look into a database to see if there is something they should be doing. Kee On Sep 30, 2010, at 7:11 AM, dunb...@aol.com wrote: > I don't really know what you intend, but you probably do not want to lock > yourself into a repeat loop. As others have suggested, "send in time with > messages" is very effective, and then call that again: > > on myMessage > > doYourStuff > > send myMessage to me in 1 miilisecond with messages > > end myMessage > > Or someSuch. > > Craig Newman > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution - I check email roughly 2 to 3 times per day. Kagi main office: +1 (510) 550-1336 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
On Sep 30, 2010, at 7:15 AM, Mike Bonner wrote: > If you DO use a repeat loop, the 'wait with messages' is pretty much > obligatory right? Have never used it but it seems like a good thing to include as a general housekeeping kind of thing. > So you can setup an exit strategy and so that pending > messages (such as sends and dispatches) will still be processed, right? I don't use send in time I just use immediate sends. Current handler halts until the send completes. From what I can see in the dos, dispatch is also an immediate thing. It blocks until it completes. Kee___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: controls with ID 0
Claudi Cornaz wrote: Hi all, I have a very strange situation where controls get a ID of 0. ID zero is reserved for all the template objects (templateButton, templateField, etc.) It does sound like a bug, but it may have something to do with copying the template object. It would be good to report it. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Livecode resources
On 09/30/2010 12:47 AM, Jim Lambert wrote: On building a Windows standalone from LiveCode 4.5, I get this notice: "Icon does not exist:/Applications/Revolution Enterprise/revEnterprise 4.5 (dp 4).app/Contents/Tools/Runtime/Windows/x86-32/Support/Sample Icons/genericapp.ico" Why would LiveCode look in "Revolution Enterprise"? I thought everything (but 'My LiveCode" stuff) was now supposed to be in LiveCode's own application bundle. Jim Lambert___ Well; if you read the LiveCode documentation you will realise that LiveCode is schizophrenic - there are constant references to something called 'Runtime Revolution', and a few to 'LiveCode'. Under other circumstances one might coclude that soemting was a rush job, and insufficient care was taken in some areas . . . ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RSS Feed for revLessons
I have my email client, Thunderbird, subscribed to the revLessons... I could have sworn that previously when I opened one of these posts in tBird there was a link to click to go to the lesson... but now the body of each article in Thunderbird has only this: e.g. "This lesson will show you the basics of using AJAX with revServer by demonstrating how to create a simple auto-complete box." With no link to go to the actual lesson.. What am I missing? After three years being away from web dev and stack dev, I'm back! This is too much fun. Sivakatirswami ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: send vs dispatch and continuously running processes
I have a tutorial stack on using send, should anyone be interested. I called it message machinery or something like that. I made it back when Revolution was coal fired. It is on my website which is even older. Try here: http://pages.swcp.com/~dsc/revstacks.html Dar On Sep 30, 2010, at 8:11 AM, dunb...@aol.com wrote: I don't really know what you intend, but you probably do not want to lock yourself into a repeat loop. As others have suggested, "send in time with messages" is very effective, and then call that again: on myMessage doYourStuff send myMessage to me in 1 miilisecond with messages end myMessage Or someSuch. Craig Newman ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
INSERT into PostGreSQL triggers "RevdbError" but no error
Slightly OT if this is more about PostGreSQL than LiveCodeServer I'm doing my very first dbase insertion from an iRev form. finally getting a successful a connection ID after fiddling with pg_hba.conf ASIDE: does RevServer connect on local unix domain socket or local tcp/ip Then tried this (all copied from the rev lesson on line) get revOpenDatabase("postgresql","localhost","useful_rodents","human","") #no password required. put "INSERT INTO rats-w-wings (first_name, last_name, anonymous) \ VALUES ('Batman', 'MosquitoEater', TRUE);" into tSQL # we have to keep him anonymous because # he's embarrassed that he eats mosquitos. # sorry... I'm into kids' stories lately... I like to have fun the names of # my test objects and vars... lightens up tedious debugging -- query the database put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData -- check the result and display the data or an error message if item 1 of tData = "revdberr" then put "There was a problem querying the database:" & cr & tData into tResponse else put tData into tResponse end if Now the odd part: tData returns "revdberr," but no error verbiage So I'm scratching my head... I open PhpPgAdmin and check... Aha! Batman is there in Row 1! So, why the mysterious revdberr, from revServer? So I log in via terminal sudo postgres and try the insertion "by hand" useful_rodents=# INSERT INTO rats-w-wings (first_name, last_name, anonymous) VALUES ('Batman', 'MosquitoEater', TRUE); % INSERT 0 1 useful_rodents=# I'm back at the prompt: Again,quick check and the insertion of the data works... Null is allowed in all fields except anonymous, I'm a complete SQL newbie: what do the params being returned after INSERT "0 1" mean? the "useful_rodents" table has one row successfully added and the useful_rodents_rat-w-wings_seq integer which is linked the main table primary key: rat-w-wings_id is incremented by one integer... so two things are happening on insertion. and as far as I can tell, no errors are being generated... unless one of those two mysterious results params "INSERT 0 1" are telling us something I don't understand (searching the web for the meaning of those two results integers, but not getting anything) so, why the revdberr, ? Any ideas? Thanks! Sivakatirswami ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: INSERT into PostGreSQL triggers "RevdbError" but no error
Have an eye on this about irev <=> postgreSQL production state design skills : > put "SELECT module_name,activation FROM" && CustModules > && "WHERE module_name = '" & tparam1 & "'" into sqlStatement > put revQueryDatabase(myDatabaseID,sqlStatement) into > dbCursorID > if dbCursorID is not a number > then return the result > else > > put > revDatabaseColumnNamed(dbCursorID,"activation") into nModuleState > if nModuleState is in "NY" then > > if nModuleState is "Y" > then put "N" into nModuleState > else if nModuleState is "N" > then put "Y" into nModuleState > put "UPDATE" && CustModules && "SET > activation = '" & nModuleState & "' WHERE module_name = '" & tparam1 & "'" > into sqlStatement2 > revExecuteSQL myDatabaseID,sqlStatement2 > if the result is not a number > then return the result > else > return "MODULE_" & nModuleState > & "_OK" > end if > > else > > put "INSERT INTO" && CustModules && > "(module_name,activation) VALUES ('" & tparam1 & "','Y')" into sqlStatement2 > revExecuteSQL myDatabaseID,sqlStatement2 > if the result is not a number > then return the result # "error while > submitting the INSERT statement ..." > else return "MODULE_UPDATE_OK" > > end if > > end if each "then return the result" will expose the original postgreSQL error message HTH, P. Le 30 sept. 2010 à 23:54, Sivakatirswami a écrit : > Slightly OT if this is more about PostGreSQL than LiveCodeServer > > I'm doing my very first dbase insertion from an iRev form. finally getting > a successful a connection ID after fiddling with pg_hba.conf > > ASIDE: does RevServer connect on local unix domain socket or local tcp/ip > > Then tried this (all copied from the rev lesson on line) > > get revOpenDatabase("postgresql","localhost","useful_rodents","human","") > #no password required. > > put "INSERT INTO rats-w-wings (first_name, last_name, anonymous) \ > VALUES ('Batman', 'MosquitoEater', TRUE);" into tSQL > > # we have to keep him anonymous because > # he's embarrassed that he eats mosquitos. > # sorry... I'm into kids' stories lately... I like to have fun the names of > # my test objects and vars... lightens up tedious debugging > > -- query the database > > put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData > > -- check the result and display the data or an error message > >if item 1 of tData = "revdberr" then >put "There was a problem querying the database:" & cr & tData into > tResponse >else >put tData into tResponse >end if > > Now the odd part: tData returns "revdberr," but no error verbiage > > So I'm scratching my head... I open PhpPgAdmin and check... > > Aha! Batman is there in Row 1! So, why the mysterious revdberr, from > revServer? > > So I log in via terminal sudo postgres and try the insertion "by hand" > > useful_rodents=# INSERT INTO rats-w-wings (first_name, last_name, anonymous) > VALUES ('Batman', 'MosquitoEater', TRUE); > > % INSERT 0 1 > > useful_rodents=# I'm back at the prompt: > > Again,quick check and the insertion of the data works... Null is allowed in > all fields except anonymous, > > I'm a complete SQL newbie: what do the params being returned after INSERT "0 > 1" mean? the "useful_rodents" table has one row successfully added and the > useful_rodents_rat-w-wings_seq integer which is linked the main table primary > key: rat-w-wings_id is incremented by one integer... so two things are > happening on insertion. and as far as I can tell, no errors are being > generated... unless one of those two mysterious results params "INSERT 0 1" > are telling us something I don't understand (searching the web for the > meaning of those two results integers, but not getting anything) > > so, why the revdberr, ? > > Any ideas? > > Thanks! > > Sivakatirswami > > > > > > > > ___ >
Re: send vs dispatch and continuously running processes
> on myMessage > doYourStuff > send myMessage to me in 1 miilisecond with messages > end myMessage > This seems like a good pattern for an app driven by a human. The apps I tend to write launch and then run forever. They constantly look into a database to see if there is something they should be doing. This can be used as effectively for server type apps that never stop, daemons if you will. > If you DO use a repeat loop, the 'wait with messages' is pretty much obligatory right? Have never used it but it seems like a good thing to include as a general housekeeping kind of thing. This is useful to insert into long running tight loops, so the system gets some breathing space. Whether use this or sends in time, or both, depends on specific tasks. > So you can setup an exit strategy and so that pending messages (such as sends and dispatches) will still be processed, right? I don't use send in time I just use immediate sends. Current handler halts until the send completes. There is place for immediate sends/calls and there is place for sends in time. Immediate sends/calls are ways to invoke remote handlers (value for functions). Sends in time are for polled execution, allowing sort of primitive pseudo-threading. Dispatch I see basically as a variant of immediate call. Robert ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: loading another stack from splash
On 9/28/10 5:11 PM, Mark Smith wrote: Also, it would be real nice not to have to "hard code" the path in case I want to change its location. Having to manage two stacks instead of one does seems like an added burden. Stumped. Any help appreciated -- Mark We meaning many of us here... do this all the time. I love keeping stacks inside the OSX application bundle, you can develop them from inside there and ship as as single binary.. There are two common approaches These scripts may help on loadFromDisk -- Setting the default folder. set itemdel to "/" set the defaultfolder to item 1 to -2 of the effective filename of this stack -- Check for application if there is not a file "MyNoteBook.rev" then if checkNet() then checkNetworkAndDownload #If you don't have it locally then get it from the web server exit loadFromDisk else answer error "Please connect to the internet to install this application" exit loadFromDisk end if end if go stack url "binfile:MyNoteBook.rev" hide stack "MySplashEngine.rev" end loadFromDisk - on preopenstack go stack url (getPath("MyNoteBook.rev") end preopenstack function getPath tStack set the itemdel to "/" put the effective filename of this stack into tPath put tStack into item -1 of tPath return tPath end getPath By separating the function you have the interesting option of offering the user the option to open any number stacks you might bundle into the same folder: On the splash screen you can have a pull down menu like this on mousedown set the defaultfolder to item 1 to -2 of the effective filename of this stack put the files into tFiles filter tFiles with ("*.livecode") put tFiles into me end mousedown on menuPick pStack go stack url (getPath(pStack)) hide this stack # hide the splash screen now... end menupick Now you can put what ever stacks you like into that folder. Don't forget to include quit handlers in all the stacks so that you don't leave a hung process Hidden splash screen still running. HTH aloha Mark assuming that you will always put the data stacks in the same folder as the splash-engine stack ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: uuencode/uudecode
Sorry about the delay - I started this interesting exercise, but got distracted . Here's a simple script that handles uuencoding a file. It's been moderately, but not thoroughly, tested. on mouseUp answer file "Select a file" if it is empty then exit mouseUp put URL ("binfile:" & it) into tOriginal -- put "Cat" into tOriginal put uuencode(tOriginal, "000", "text") into tEncoded put tEncoded after field "fLog" put CR & the number of chars in tOriginal && the number of chars in tEncoded after field "fLog" end mouseUp function uuencode pData, pPermission, pName put 1 into tBase put "begin" && pPermission && pName & CR into tOutput put the number of chars in pData into tLen put numToChar(0) & numToChar(0) & numToChar(0) after pData put empty into tLine repeat until tBase > tLen-2 -- i.e. all full words before the padding put charToNum(byte tBase of pData) * 256 * 256 into t add charToNum(byte tBase+1 of pData) * 256 to t add charToNum(byte tBase+2 of pData) to t put numToChar((t mod 64)+32) into t4 put t div 64 into t put numToChar((t mod 64)+32) into t3 put t div 64 into t put numToChar((t mod 64)+32) into t2 put t div 64 into t put numToChar(t+32) & t2 & t3 & t4 after tLine if the number of chars in tLine = 60 then put numToChar(the number of chars in tLine * 3 / 4 + 32) & tLine & CR after tOutput put empty into tLine end if add 3 to tBase end repeat if tLine is not empty then put numToChar(the number of chars in tLine * 3 / 4 + 32) & tLine & CR after tOutput end if put "`" & CR & "end" & CR after tOutput return tOutput end uuencode On 23/09/2010 19:56, Phil Davis wrote: Hi Matthias, With LiveCode on Mac OS X you could use a shell() command and let the 'uuencode' line command do the work. Not sure about Windows... there doesn't seem to be a direct way to uuencode a file - no 'uuencode' command, nor any way to do it using PowerShell (AFAIK). Do you feel like writing your own LC uu library? That should be doable. More info about the uuencode spec: http://en.wikipedia.org/wiki/Uuencoding http://www.opengroup.org/onlinepubs/009695399/utilities/uuencode.html Phil On 9/23/10 7:42 AM, Matthias Rebbe wrote: Hi, how can i uuencode data with LiveCode? Do i need 3rd party tools for that? i cannot find anything about it, when searching the dictionary for uuencode. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
ANN: Installer Maker Plugin 1.4.1
Hi all, This is an important announcement for all users of the Installer Maker Plugin. A user found a small but important bug in the Installer Maker Plugin earlier today. The bug has been fixed and it is recommended to download the latest version of the plugin. You can download a new copy of the Installer Maker Plugin at http://qurl.tk/ce and more information can be found at http://qurl.tk/i0 . -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: INSERT into PostGreSQL triggers "RevdbError" but no error
Aloha, Pierre: Thank you! there is nothing wrong with my SQL If I use: --- put "INSERT INTO some-table (first_name, last_name, anonymous) VALUES ('Batman', 'MosquitoEater', TRUE);" into tSQL revExecuteSQL gConnectionID,tSQL put the result into tResponse --- I get '1' which is success ergo: if my assumptions are correct, if you use revDataFromQuery for an insertion and query the result you will get an error. which makes sense... the latter is getting data out, the former is putting data in. Problem solved, or rather, no problem at all except, I was using the wrong rev dbase command for inserting data. I guess I should probably study every single one of the revdb cmds in the library. Om shanti Sivakatirswami On 9/30/10 12:17 PM, Pierre Sahores wrote: Have an eye on this about irev<=> postgreSQL production state design skills : >put "SELECT module_name,activation FROM"&& CustModules&& "WHERE module_name = '"& tparam1& "'" into sqlStatement >put revQueryDatabase(myDatabaseID,sqlStatement) into dbCursorID >if dbCursorID is not a number >then return the result >else > >put revDatabaseColumnNamed(dbCursorID,"activation") into nModuleState >if nModuleState is in "NY" then > >if nModuleState is "Y" >then put "N" into nModuleState >else if nModuleState is "N" >then put "Y" into nModuleState >put "UPDATE"&& CustModules&& "SET activation = '"& nModuleState& "' WHERE module_name = '"& tparam1& "'" into sqlStatement2 >revExecuteSQL myDatabaseID,sqlStatement2 >if the result is not a number >then return the result >else >return "MODULE_"& nModuleState& "_OK" >end if > >else > >put "INSERT INTO"&& CustModules&& "(module_name,activation) VALUES ('"& tparam1& "','Y')" into sqlStatement2 >revExecuteSQL myDatabaseID,sqlStatement2 >if the result is not a number >then return the result # "error while submitting the INSERT statement ..." >else return "MODULE_UPDATE_OK" > >end if > >end if each "then return the result" will expose the original postgreSQL error message HTH, P. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Listing all the unique words in a piece of text (Resource Center broken?)
There's a sample script in the LiveCode Resource Center called "listing all the unique words in a piece of text." It's located under "Resource Center/Sample Scripts/Text/Listing all the ..." There's a button available to download the script. Unfortunately it doesn't appear to work and I can't peek into the actual button containing the script. I used both LiveCode and Rev Studio 4.0... same result. If anyone has a minute to look and see if this is consistent with their setup, I'd appreciate it. (Or if anyone has the code, I'd appreciate getting it.) Thanks, Mark___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Listing all the unique words in a piece of text (Resource Center broken?)
I stumbled upon the solution to my own problem quite by accident. After clicking on "copy script" of another item (with again no feedback whatsoever) I went back to my stack and attempted to paste a different script into a field (not the button script as I had tried before), on the off chance it would paste. Buttons and fields appeared out of nowhere. You're not copying the script, but an entire group and the objects it holds, and you're not given any feedback. I'm glad I have the script, but this implementation is pretty funky. Mark On Sep 30, 2010, at 8:17 PM, Mark Swindell wrote: > There's a sample script in the LiveCode Resource Center called "listing all > the unique words in a piece of text." It's located under "Resource > Center/Sample Scripts/Text/Listing all the ..." > > There's a button available to download the script. Unfortunately it doesn't > appear to work and I can't peek into the actual button containing the script. > > I used both LiveCode and Rev Studio 4.0... same result. > > If anyone has a minute to look and see if this is consistent with their > setup, I'd appreciate it. (Or if anyone has the code, I'd appreciate getting > it.) > > Thanks, > Mark ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Listing all the unique words in a piece of text (Resource Center broken?)
Hi Mark, It's not hard! repeat for each word tWord in tYourtext add 1 to aWordCounts[tWord] end repeat put the keys of aWordCounts into tList sort lines of tList put tList ... but you probably figured this out by now. Phil On 9/30/10 8:17 PM, Mark Swindell wrote: There's a sample script in the LiveCode Resource Center called "listing all the unique words in a piece of text." It's located under "Resource Center/Sample Scripts/Text/Listing all the ..." There's a button available to download the script. Unfortunately it doesn't appear to work and I can't peek into the actual button containing the script. I used both LiveCode and Rev Studio 4.0... same result. If anyone has a minute to look and see if this is consistent with their setup, I'd appreciate it. (Or if anyone has the code, I'd appreciate getting it.) Thanks, Mark___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- Phil Davis PDS Labs Professional Software Development http://pdslabs.net ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
WINDOWS VERSION MENU PROBLEM - architect
Hi everyone, The Window's version of my app displays the following Menu: The File and Go Menus are the ones with black backgrounds. The Mac Version is fine. I've checked the backColors and hilite properties that "might" be the cause of this idiosyncrasy to no avail. Any ideas. The Windows version is run in XP under Fusion. Also, something that might be "related" to this: The text selections in editable text fields are comparably dark. There's probably a place to set this color, but I've yet to find it. I'm not too "up" on the use of Windows. TIA, Joe Wilkins ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: WINDOWS VERSION MENU PROBLEM - architect
I see that the List won't allow me to show even a very small screen shot. So, to describe the problem in words: The menu consists of four menus - File Edit Go Help. The menus all work, but you can't read the File or Go menus easily. It's as if the background is set to some very dark color. TIA, Joe On Sep 30, 2010, at 11:38 PM, Joe Lewis Wilkins wrote: > Hi everyone, > > The Window's version of my app displays the following Menu: > > > The File and Go Menus are the ones with black backgrounds. The Mac Version is > fine. I've checked the backColors and hilite properties that "might" be the > cause of this idiosyncrasy to no avail. Any ideas. The Windows version is run > in XP under Fusion. Also, something that might be "related" to this: The text > selections in editable text fields are comparably dark. There's probably a > place to set this color, but I've yet to find it. I'm not too "up" on the use > of Windows. > > TIA, > > Joe Wilkins > > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution