Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
marksmithhfx
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Post
by marksmithhfx » Wed Jul 07, 2021 11:46 am
Can anyone tell me what this construct in the dictionary means? I did look around but couldn't find anything to explain it and I've never seen a variable with an *b in front of it.
Code: Select all
revExecuteSQL myDatabaseID, the text of field "Query", "*bMyVar"
Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
-
elanorb
- Livecode Staff Member
- Posts: 516
- Joined: Fri Feb 24, 2006 9:45 am
Post
by elanorb » Wed Jul 07, 2021 11:55 am
Hi Mark,
The "*b" is prepended to the variable name if it contains binary data. The revExecuteSQL command strips the binary marker "*b" and passes it to the database as binary data, rather than text data.
An example would be passing image data to be stored in a BLOB in the database.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
-
marksmithhfx
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Post
by marksmithhfx » Wed Jul 07, 2021 2:57 pm
elanorb wrote: ↑Wed Jul 07, 2021 11:55 am
The "*b" is prepended to the variable name if it contains binary data. The revExecuteSQL command strips the binary marker "*b" and passes it to the database as binary data, rather than text data.
Thanks Elanor, I thought it might be that but I couldn't find anything in the dictionary under binary, binary data, etc that discussed that specific nomenclature.
Good to know
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
-
elanorb
- Livecode Staff Member
- Posts: 516
- Joined: Fri Feb 24, 2006 9:45 am
Post
by elanorb » Wed Jul 07, 2021 3:28 pm
Hi Mark
I think the "*b" is only documented in the Dictionary entries for revExecuteSQL, revQueryDatabase and revDataFromQuery, in the Description section. I am not sure if it is documented on it's own anywhere.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
-
marksmithhfx
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Post
by marksmithhfx » Wed Jul 07, 2021 5:35 pm
elanorb wrote: ↑Wed Jul 07, 2021 3:28 pm
I think the "*b" is only documented in the Dictionary entries for revExecuteSQL, revQueryDatabase and revDataFromQuery, in the Description section. I am not sure if it is documented on it's own anywhere.
Hi Elanor,
Reading a bit further in the revExecuteSQL documentation (I haven't checked the other commands) I found this:
To pass binary data in a variable in the variablesList, prepend "b" to the variable name. The revExecuteSQL command strips the binary marker "b" and passes it to the database as binary data, rather than text data.
It doesn't refer to the "*" in front of the "b". Does that char serve a special purpose, or is just an alternate form of the same specification?
Best,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
-
marksmithhfx
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Post
by marksmithhfx » Wed Jul 07, 2021 5:41 pm
Ah, I should have read the other two before posting, they both refer to "*b". So, either two ways of doing it or a bit of an oversight in revExecuteSQL.
M
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
-
richmond62
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Post
by richmond62 » Wed Jul 07, 2021 8:14 pm
specific nomenclature
Presumably that "*b" is a subjective thing and could just as easily be "binary" or "myCamelisCalledClotilde"?
Just going through the annual "agony" of explaining to children that a variable can be called anything (well, except for a word used
in the LiveCode language) . . . not an easy concept for young sprogs.
-
elanorb
- Livecode Staff Member
- Posts: 516
- Joined: Fri Feb 24, 2006 9:45 am
Post
by elanorb » Thu Jul 08, 2021 9:24 am
Hi Mark
marksmithhfx wrote: ↑Wed Jul 07, 2021 5:41 pm
Ah, I should have read the other two before posting, they both refer to "*b". So, either two ways of doing it or a bit of an oversight in revExecuteSQL.
M
I went to report a bug about the revExecuteSQL entry and it has already been reported. By me, so I should have remembered
https://quality.livecode.com/show_bug.cgi?id=22936
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode