Page 1 of 1

*bMyVar

Posted: Wed Jul 07, 2021 11:46 am
by marksmithhfx
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

Re: *bMyVar

Posted: Wed Jul 07, 2021 11:55 am
by elanorb
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

Re: *bMyVar

Posted: Wed Jul 07, 2021 2:57 pm
by marksmithhfx
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

Re: *bMyVar

Posted: Wed Jul 07, 2021 3:28 pm
by elanorb
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

Re: *bMyVar

Posted: Wed Jul 07, 2021 5:35 pm
by marksmithhfx
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

Re: *bMyVar

Posted: Wed Jul 07, 2021 5:41 pm
by marksmithhfx
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

Re: *bMyVar

Posted: Wed Jul 07, 2021 8:14 pm
by richmond62
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. 8)

Re: *bMyVar

Posted: Thu Jul 08, 2021 9:24 am
by elanorb
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