Easier syntax for quoting text and html?

Jim Ault jimaultwins at yahoo.com
Fri Jan 1 10:29:02 EST 2010


Imagine in my right hand I hold a snowball, and off to my left is an  
actuarial expert with a very powerful calculator that will determine  
the odds of it reaching the target of multi-line and C-style code in  
the xTalk IDE.  I hurl the snowball, the LED display flickers and the  
answer is 7734.
Oh wait, it is the old calculator trick of showing the answer upside  
down.

Could not resist the joke that made the rounds in the late 1960's when  
I was in college.

Anyway, the archives have the discussion of the anomaly of being able  
to set a variable using an equal sign instead of 'put'.
I think this only occurs when declaring a local or constant with a  
value.
To me the origins are uncertain.

Consider that IREV allows the following 3-line script to work by  
reading each line literally...

<html>
It is <b>traditional</b> to say "Happy New Year" at this time of year,  
& why
</html>


The real power of the web servers is in javascript, jquery, and php...  
so now where do we stop on the slippery slope of editing features that  
appeal to web programmers?

As you can tell, I am fine with Rev editor conventions since I use the  
chunking tools to build the many constructs I need for web server  
programming.

As Trevor did many years ago, someone may build a lib stack that does  
the same thing for HTML as he did for SQL.
Maybe the team is working on this already.

Happy New Year

Jim Ault
Las Vegas

On Jan 1, 2010, at 6:10 AM, David Bovill wrote:

> 2009/12/31 Jim Ault <jimaultwins at yahoo.com>
>
>>  --// html honors both quote types, ignores extra spaces
>>  --// javascript honors both quote types
>>
>>  --build the Rev string without ANY ampersands
>>  --use single, not double quotes
>>
>
> I use single quote - but run into some problems so got lazy and  
> replaced
> then at the end with "replace "'" with quote. Not sure what  
> situations cause
> the problems - is it OK to use single quotes in Rev htmlText? Not  
> sure. But
> thanks for the tip
>
> NB - I do think that RunRev should add syntax to the language to  
> make html
> quoting very easy to use for both iRev scripts We need an elegant  
> solution
> to quoting html - other languages are easier to use and read with  
> regard to
> html quoting! using our own custom functions does not make read/ 
> writeability
> that much easier, and makes it harder to share scripts.
>
> My personal choice would be to have an in-script syntax for putting  
> raw text
> into a variable. The idea would be that you could type the text  
> inside some
> sort of markup, in a way in which you could write anything, and then  
> assign
> it to a variable. That way you could just copy html or whatever and  
> paste it
> into the script editor - easy and readable.
>
> While you can do this with custom properties - and the IDE could be  
> changed
> to make it easier to relate values in custom properties to the  
> scripts by
> showing both in the same window - I'd prefer the ability to do this  
> all in a
> script. This is also important for iRev server side scripts, where  
> custom
> properties are less easy to use.
>
> My suggestion is to extend the syntax for local variables and  
> constants.
> Currently we have:
>
> local someHtml = "<b> hello world </>"
>>
>
> How about something like:
>
> local someHtml = {
>>    <b> hello world </>
>> }
>>
>
>
> This would then allow doing things like:
>
> local someHtml = {
>> It is <b>traditional</> to say "Happy New Year" at this time of  
>> year, & why
>> not?
>>
>> You could 'single quote' or "double quote" etc
>> }
>>
>
> Alternatives could be to use quotes as they are (but allow a special
> exception for multiple lines):
>
> local someHtml = "
>> <b> hello world </>
>> "
>>
>
> or to use C style quotes:
>
> local someHtml = /*
>> <b> hello world </>
>> */
>>
>
> If you like this suggestion maybe vote for it / improve it here -
> http://quality.runrev.com/qacenter/show_bug.cgi?id=8517
>
> NB - at the same time perhaps as implementing this RunRev could take  
> the
> opportunity to enhance local/constant functionality by allowing a  
> script to
> assign values to locals (and constants?) as the value of an  
> expression:
>
> local someHtml = the htmltext of fld 1
>> local someValue = fetchSomething("new")






More information about the use-livecode mailing list