Search found 587 matches

by phaworth
Fri Oct 09, 2015 1:27 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: "new" JSON library fastJson
Replies: 62
Views: 37506

Re: "new" JSON library fastJson

I'm finding that this library and a couple of others I've tried are returning an error when trying to parse the JSON used for the dictionary in LC8. Not much in the way of details, just a message that it failed instead of an array. On my Mac, the file is in Applications/Contents/Tools/Documentation/...
by phaworth
Sun Aug 16, 2015 8:16 pm
Forum: Databases
Topic: Inserting string with special characters into MySQL field
Replies: 24
Views: 28462

Re: Inserting string with special characters into MySQL fiel

Generically, a numeric value in the result indicates the number of rows affected by the SQL statement so it won't always be 1. AN UPDATE with a WHERE statement for example, might affect several rows. Same for a DELETE with WHERE. I guess in this case, you know for a fact that only 1 row should be in...
by phaworth
Sun Aug 16, 2015 2:27 am
Forum: Databases
Topic: INSERT AND VIEW IMAGES IN sqlite
Replies: 8
Views: 8798

Re: INSERT AND VIEW IMAGES IN sqlite

The *b before the variable name tells lc it contains binary data. No need to base64encode it if the db column is defined as BLOB.
Pete
by phaworth
Sat Aug 15, 2015 11:22 pm
Forum: Databases
Topic: INSERT AND VIEW IMAGES IN sqlite
Replies: 8
Views: 8798

Re: INSERT AND VIEW IMAGES IN sqlite

Your code looks fine to me. The way I display images stored in a database is as follows: - SELECT the row containing the image data. You will have to use revQueryDatabase to do this to create a database cursor. - Use revDtabaseColumnNamed to get the contenets of your imagen column from the database ...
by phaworth
Wed Aug 05, 2015 11:09 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Local: name shadows another variable BUG!!!!
Replies: 14
Views: 8568

Re: Local: name shadows another variable BUG!!!!

I've been careful to note if I stopped debug early before the error occurs and so far, that has been the case every time. So at least for me, that is the cause of the problem. I'm still faced with quitting and restring LC when it does happen (or switch off Strict Compilation Mode), so I'm training m...
by phaworth
Wed Aug 05, 2015 10:45 pm
Forum: Databases
Topic: DataBase Cursor
Replies: 25
Views: 15344

Re: DataBase Cursor

Check the contents of pdataarray["jokeid"] to make sure it doesn't have any non-ascii or other strange characters in it.
by phaworth
Tue Aug 04, 2015 3:54 pm
Forum: Databases
Topic: DataBase Cursor
Replies: 25
Views: 15344

Re: DataBase Cursor

You have to use the FillInData handler of the row behavior script to load the controls in a row from the array which is a parameter to to the handler. Check out the datagrid manual for an example.
Pete
by phaworth
Mon Aug 03, 2015 5:55 pm
Forum: Databases
Topic: DataBase Cursor
Replies: 25
Views: 15344

Re: DataBase Cursor

Do you get the error the first time through the repeat loop or later? Even if there was no error, you will miss processing the last record. revQueryIsAtEnd returns true when the current record in the cursor is the last one so your revMoveToNextRecord will eventually get to the last record then your ...
by phaworth
Sat Aug 01, 2015 7:56 pm
Forum: Databases
Topic: Alter Table syntax - SQLite
Replies: 2
Views: 3304

Re: Alter Table syntax - SQLite

SQLite does have IF NOT EXISTS on the CREATE xxx commands but not on the ALTER Table command. If you need to check for the existence of a column before executing the ALETR TABLE command, try using the revDatabaseColumnNames command and checking the output. Or you can revDataFromQuery with a PRAGMA t...
by phaworth
Thu Jul 30, 2015 8:24 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: So far not a fan...
Replies: 29
Views: 12309

Re: So far not a fan...

One interesting thing about this is that apparently including any text outside of handler block in a script does not result in compile errors. I guess it's pretty obvious you shouldn't do that once you understand how LC works but in this case,it would have alerted the OP to the root cause of the pro...
by phaworth
Tue Jul 21, 2015 10:16 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Unicode in Fields and SQLite
Replies: 12
Views: 9143

Re: Unicode in Fields and SQLite

You're welcome!
Pete
by phaworth
Mon Jul 20, 2015 6:01 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Unicode in Fields and SQLite
Replies: 12
Views: 9143

Re: Unicode in Fields and SQLite

I believe he said he was using LC 7 so textEncode and textDecode are the recommended ways since the urlxxx equivalents have been deprecated. But you're right, no matter which ones you use, you have to use them for any db access.
by phaworth
Sat Jul 18, 2015 8:34 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Unicode in Fields and SQLite
Replies: 12
Views: 9143

Re: Unicode in Fields and SQLite

Use textEncode on any data in an INSERT/UPDATE statement, for example: revExecuteSQL gDBID,”UPDATE Customers SET Custname=” & makeString(textEncode(field “Name”,”UTF8”)) -- makestring is just a handler that puts single quotes around a string When you SELECT date, use textDecode, for example: put tex...
by phaworth
Mon Jul 13, 2015 5:17 pm
Forum: Databases
Topic: Show MySQL data in a field
Replies: 6
Views: 5331

Re: Show MySQL data in a field

See if there is a file with the same name as your stack file but with a "~" character at the start in the same folder as the original stack. If so, try opening it.. Another thing that can happen is if the stack was saved with LC v7 and then you try to open it with LC v6 or earlier, this message is d...
by phaworth
Fri Jul 10, 2015 8:19 pm
Forum: Databases
Topic: Show MySQL data in a field
Replies: 6
Views: 5331

Re: Show MySQL data in a field

This is a compile error, correct? Which is line 11 in your script and what's the rest of the error message? Not related to your problem but Couple of other things to watch out for. I think your error check should be "if word 1 of tData..." not "if item1 of tData..." The SELECT should work just fine,...

Go to advanced search