changing the size of the image that's combined with text

Peter M. Brigham pmbrig at gmail.com
Tue Feb 16 08:44:49 EST 2016


On Feb 16, 2016, at 1:32 AM, Matt Maier wrote:

> I found the right syntax for writing html that will combine text and images:
> <p><img src="binfile:C:\Users\user\pics\somepic.png" char="b">lerg</p>
> and also that the char reference isn't necessary, so this works
> <p><img src="binfile:C:\Users\user\pics\somepic.png"></p>
> It's a bit tedious to code, since you have to escape the quotes like this:
> put "<p><img src=" & quote & "binfile:C:\Users\user\pics\somepic.png" &
> quote & "></p>" into tHTML
> but whatevs, it works.

A slightly tangential offering — here's what I use to create strings that contain quotes — it simplifies the tedious and error-prone process of constructing these strings.

-------

function qInString pStr, pAltChar
   -- use for creating strings that contain quotes
   --    eg, for constructing ask/answer dialogs, error messages, etc.
   -- default is to use "^" as quote placeholder, can be overridden
   -- eg,
   --    qInString("fld ^text^ of card ^apple^ of stack ^fruits^")
   -- returns:
   --    fld "text" of card "apple" of stack "fruits"
   -- shorter, and easier to proofread than
   --    put "fld" && quote & "text" & quote && "of card" && quote & "apple" \
      --        & quote && "of stack" && quote & "fruits" & quote into tStr
   -- by Peter M. Brigham, pmbrig at gmail.com — freeware
   --    from a handler on the Use-LC list
   
   if pAltChar = empty then put "^" into pAltChar
   replace pAltChar with quote in pStr
   return pStr
end qInString

-------

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list