RE: SQLite Issue
Hi Sarah, > What about: > > put edName into myArray[name] > put edAddress into myArray[address] > > or > > put edName into myArray[1] > put edAddress into myArray[2] > > Is this what you were trying to do? Exactly! And I got it working as well. :-) Again - this list and the people on it are awesome! :-) My biggest hope now is to progress with Rev' to the extent that I can help others too. :-) BTW - I'm even considering retiring Delphi for certain applications I'm working on. For me that is a *huge* step as I've been coding in Object Pascal since 1994 when Borland released the first Beta (known then as "VB Killer"). I haven't had to learn a new language since then as I came from a Clipper/Turbo C/Turbo Pascal background before that. Rev' really rocks! :-) Scott ___ 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: SQLite Issue
Hi Jim, Chipp and Dave... I worked it out thanks to your help. Works beautifully now! I'm back to where I was again with my code. Thank you all a heap!! :-) Scott ___ 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: SQLite Issue
> Agreed. I got so messed up with it all I threw the > example together. Really there should be no loop at > all as it is not needed. What I'm really having trouble > with is placing each edit field into the array. I know > the problem is a lack of script knowledge and that's > doubly frustrating when I know how to do the same > thing in three other programming languages without > even giving it a second thought. For some > reason some parts of Rev scripting just don't gel > in my mind as yet. What I'm really trying to do is > place the value of fields into the array that make > up a data entry stack. In a sense: > > Put edName into X element, Put edAddress into x element. What about: put edName into myArray[name] put edAddress into myArray[address] or put edName into myArray[1] put edAddress into myArray[2] Is this what you were trying to do? Cheers, Sarah ___ 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: SQLite Issue
Hi Jim and all, > It seems that 'put field "edName" into i' would make the > value of that variable the same both times thru the loop, > thus "name" would become the field value and "email" would > become the field value as well. Agreed. I got so messed up with it all I threw the example together. Really there should be no loop at all as it is not needed. What I'm really having trouble with is placing each edit field into the array. I know the problem is a lack of script knowledge and that's doubly frustrating when I know how to do the same thing in three other programming languages without even giving it a second thought. For some reason some parts of Rev scripting just don't gel in my mind as yet. What I'm really trying to do is place the value of fields into the array that make up a data entry stack. In a sense: Put edName into X element, Put edAddress into x element. I should've waited to send a proper example the first time, I had to go out and was in a bit of a hurry. Scott ___ 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: SQLite Issue
On 12/26/05 8:52 PM, "Scott Kane" <[EMAIL PROTECTED]> wrote: > put "name,email" into tColumnItems > repeat for each item I in tColumnItems > --ask question "New value for column: " & I > put Field "edName" into i > --if it is empty or the result is "cancel" then exit to top > put "'" & cleanSQL(it) & "'" & "," after tRowData > end repeat Not sure what you are trying to accomplish in this loop. It seems that 'put field "edName" into i' would make the value of that variable the same both times thru the loop, thus "name" would become the field value and "email" would become the field value as well. Jim Ault Las Vegas ___ 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: SQLite Issue
On 12/26/05 8:52 PM, "Scott Kane" <[EMAIL PROTECTED]> wrote: > --> COLLECT name AND email > put "name,email" into tColumnItems > repeat for each item I in tColumnItems > --ask question "New value for column: " & I > put Field "edName" into i > --if it is empty or the result is "cancel" then exit to top > put "'" & cleanSQL(it) & "'" & "," after tRowData > end repeat Why would you be using cleanSQL(it) when you have left out the line that defines 'it' I would suggest the following syntax for clarity. I avoid using "I, l, 1,j, n, m" because they look too much alike and too similar to other reserved works such as 'it' 'item' I prefer k as a loop variable, and use caps for the variable generated when using "for each line LNN" or "for each item ITM" or "word WRD" > --> COLLECT name AND email > put "name,email" into tColumnItems > repeat for each item ITM in tColumnItems > --ask question "New value for column: " & ITM > put Field "edName" into ITM > --if it is empty or the result is "cancel" then exit to top > put "'" & cleanSQL(ITM) & "'" & "," after tRowData > end repeat Jim Ault Las Vegas ___ 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: SQLite Issue
Hi Scott, Looks like you're double referencing the same variable in your first repeat loop. You shouldn't ever set the 'for each' var during the loop and you are doing it by: put Field "edName" into i try put Field "edName" into j and don't forget to cleanSQL(j) as well. best, Chipp on mouseUp global gConID --> COLLECT name AND email put "name,email" into tColumnItems repeat for each item I in tColumnItems --ask question "New value for column: " & I put Field "edName" into i --if it is empty or the result is "cancel" then exit to top put "'" & cleanSQL(it) & "'" & "," after tRowData end repeat --> COLLECT emailList ask question "New value for column: emailList" with "true" if it is empty or the result is "cancel" then exit to top put "'" & cleanSQL(it) & "'" after tRowData --> CONSTRUCT SQL put "INSERT INTO users(userID,name,email,emailList)" & \ " VALUES(null," & tRowData & ")" into tSQL --> EXECUTE SQL put revdb_execute(gConID,tSQL) into tTmp handleRevDBerror tTmp if the result is not empty then answer warning the result exit mouseUp end if answer information "Number of rows added: " &cr& tTmp end mouseUp function cleanSQL pSQL --> THIS ESCAPES THE QUOTE PROBLEM IN SQL replace "'" with "''" in pSQL replace quote with quote & quote in pSQL --> THIS ESCAPES THE tab AND cr DELIMITERS --> IF YOU PLAN ON HAVING USERS ENTER cr AND tab THEN YOU ALSO NEED TO -->replace "*CR*" with cr IN THE RETURNED DATA! replace cr with "*CR*" in pSQL replace tab with "*TAB*" in pSQL return pSQL end cleanSQL -- End Paste -- ___ 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: SQLite Issue
On 27 Dec 2005, at 04:52, Scott Kane wrote: I'm getting the result "It" rather than the value of the field (in the example below the field is called "edName"). --> COLLECT name AND email put "name,email" into tColumnItems repeat for each item I in tColumnItems --ask question "New value for column: " & I put Field "edName" into i --if it is empty or the result is "cancel" then exit to top put "'" & cleanSQL(it) & "'" & "," after tRowData end repeat Is the "item variable" a lowercase "L" or an uppercase "i"? Anyway, you should try one of the follwing: put "'" & cleanSQL(i) & "'" & "," after tRowData or put field "edName" into it or get field "edName" Cheers Dave ___ 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