Re: Easier syntax for quoting text and html?

2010-01-02 Thread Jim Ault


On Jan 1, 2010, at 4:18 PM, Alex Tweedly wrote:


2009/12/31 Jim Ault 
 --// html honors both quote types, ignores extra spaces

Thanks Jim !! How did I get to this age in my life without realizing  
that !?



There is actually another behavior that works but is probably not as  
reliable

  ... if there are no spaces, you don't need quotes



   ...  will work with most browsers.


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Easier syntax for quoting text and html?

2010-01-02 Thread David Bovill
Yes! Much better syntax - thanks Alex, Jim and Python! Alex why not vote
for:

http://quality.runrev.com/qacenter/show_bug.cgi?id=8517

or create a new one?

2010/1/2 Alex Tweedly 

> David Bovill wrote:
>
>> 2009/12/31 Jim Ault 
>>  --// html honors both quote types, ignores extra spaces
>>
>>
> Thanks Jim !! How did I get to this age in my life without realizing that
> !?
>
>  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 first choice would be to allow either single or double quotes to delimit
> strings - then I could put the other kind within it without any problems
> (yep, idea borrowed from Python, amongst others).
>
> So we could go one step further and also borrow from Python a neat method
> of allowing multi-line strings. Instead of using *one* quote at start+end of
> the string, you use *three* of them (which is unambiguous with any existing
> valid code, afaict).  So in revTalk terms, I could do
>
> put 'I said "This way!"' into tVar
>
> put "it's mine" into tVar
>
> put """
> this is a long
> multi line string.
> I'd say "It's easy to embed quotes within it !!"
> """ into tVar
>
> Note the starting triple-quote has to be last item on line, and the closing
> triple-quote has to be first item on its line - and the first/last CR within
> the text are not part of the resulting string.
>
>  My suggestion is to extend the syntax for local variables and constants.
>> Currently we have:
>>
>>
>>
> Hmmm :-(I'd much rather find a syntax that works equally for local,
> constants and plain old expressions - see above.
>
> -- Alex.
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Easier syntax for quoting text and html?

2010-01-01 Thread Jim Ault
You may not realize that the Rev Script Editor uses html tags to  
colorize the script lines..  but it would be an interesting a  
challenge for the design team to use html tags to display html tags.


Jim Ault
Las Vegas



On Jan 1, 2010, at 4:18 PM, Alex Tweedly wrote:


David Bovill wrote:

2009/12/31 Jim Ault 
 --// html honors both quote types, ignores extra spaces

Thanks Jim !! How did I get to this age in my life without realizing  
that !?
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 first choice would be to allow either single or double quotes to  
delimit strings - then I could put the other kind within it without  
any problems (yep, idea borrowed from Python, amongst others).


So we could go one step further and also borrow from Python a neat  
method of allowing multi-line strings. Instead of using *one* quote  
at start+end of the string, you use *three* of them (which is  
unambiguous with any existing valid code, afaict).  So in revTalk  
terms, I could do


put 'I said "This way!"' into tVar

put "it's mine" into tVar

put """
this is a long
multi line string.
I'd say "It's easy to embed quotes within it !!"
""" into tVar

Note the starting triple-quote has to be last item on line, and the  
closing triple-quote has to be first item on its line - and the  
first/last CR within the text are not part of the resulting string.
My suggestion is to extend the syntax for local variables and  
constants.

Currently we have:


Hmmm :-(I'd much rather find a syntax that works equally for  
local, constants and plain old expressions - see above.


-- Alex.





___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Easier syntax for quoting text and html?

2010-01-01 Thread Jim Ault
My plan is to use irev to call various working scripts that are run in  
Rev cgi, rather than try to build functions above working code in a  
single irev script.
The way I handle multiline storage of languages like AppleScript,  
Html, Php is the following:


A non-irev solution:
The only way I can think of at the moment to get a multiline text  
script to work in Rev so that it can be simply typed verbatim and then  
used in variables, then be shared between cards, stacks, and other Rev  
users, etc. is to do the following:



### stack script 

put line 2 to -2 of the script of btn textSnip01 into multiLineVerbatim
put line 2 to -2 of the script of btn htmlSnip02 into multiLineHtml
--and you can copy and paste buttons between cards/stacks

-- if a button is NOT in a group, its ID is different on each card
-- if a button is in a group, it is the same as setting a field to  
'sharing' thus the same script is available to all cards that use that  
group



### button textSnip01 script ###
/*  --this allows compiling without errors
this is a long
multi line string.
I'd say "It's easy to embed quotes within it !!"
*/

### button htmlSnip02 script ###
/*
Major Headline
 More info on the next page if you click very fast.
If not, there will be less info.
The clock is ticking...

*/

### button appleScriptSnip03 script ###
/*
set thisUrl to "http://www.mapquest.com/maps/89117/90209/";
tell application "Safari"
make new document
set the URL of document 1 to thisUrl
delay 5
tell window 1
set prevName to the name of current tab
make new tab
set current tab to last tab
end tell
set the URL of document 1 to thisUrl
delay 5
set listt to every document
--MapQuest: Driving Directions & Business Directory
return listt
end tell
*/

One caution:  watch for tabs and high-ascii chars that may get pasted  
from other code editors


Hope this gives you a few ideas to get up and running before the  
script editor features are added.


Jim Ault
Las Vegas


On Jan 1, 2010, at 4:18 PM, Alex Tweedly wrote:


David Bovill wrote:

2009/12/31 Jim Ault 
 --// html honors both quote types, ignores extra spaces

Thanks Jim !! How did I get to this age in my life without realizing  
that !?
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 first choice would be to allow either single or double quotes to  
delimit strings - then I could put the other kind within it without  
any problems (yep, idea borrowed from Python, amongst others).


So we could go one step further and also borrow from Python a neat  
method of allowing multi-line strings. Instead of using *one* quote  
at start+end of the string, you use *three* of them (which is  
unambiguous with any existing valid code, afaict).  So in revTalk  
terms, I could do


put 'I said "This way!"' into tVar

put "it's mine" into tVar

put """
this is a long
multi line string.
I'd say "It's easy to embed quotes within it !!"
""" into tVar

Note the starting triple-quote has to be last item on line, and the  
closing triple-quote has to be first item on its line - and the  
first/last CR within the text are not part of the resulting string.
My suggestion is to extend the syntax for local variables and  
constants.

Currently we have:


Hmmm :-(I'd much rather find a syntax that works equally for  
local, constants and plain old expressions - see above.


-- Alex.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Easier syntax for quoting text and html?

2010-01-01 Thread Alex Tweedly

David Bovill wrote:

2009/12/31 Jim Ault 
  --// html honors both quote types, ignores extra spaces
  

Thanks Jim !! How did I get to this age in my life without realizing that !?

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 first choice would be to allow either single or double quotes to 
delimit strings - then I could put the other kind within it without any 
problems (yep, idea borrowed from Python, amongst others).


So we could go one step further and also borrow from Python a neat 
method of allowing multi-line strings. Instead of using *one* quote at 
start+end of the string, you use *three* of them (which is unambiguous 
with any existing valid code, afaict).  So in revTalk terms, I could do


put 'I said "This way!"' into tVar

put "it's mine" into tVar

put """
this is a long
multi line string.
I'd say "It's easy to embed quotes within it !!"
""" into tVar

Note the starting triple-quote has to be last item on line, and the 
closing triple-quote has to be first item on its line - and the 
first/last CR within the text are not part of the resulting string.

My suggestion is to extend the syntax for local variables and constants.
Currently we have:

  
Hmmm :-(I'd much rather find a syntax that works equally for local, 
constants and plain old expressions - see above.


-- Alex.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Easier syntax for quoting text and html?

2010-01-01 Thread Jim Ault
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...



It is traditional to say "Happy New Year" at this time of year,  
& why




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 


 --// 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 = " hello world "




How about something like:

local someHtml = {

hello world 
}




This would then allow doing things like:

local someHtml = {
It is 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 = "

 hello world 
"



or to use C style quotes:

local someHtml = /*

 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")




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Easier syntax for quoting text and html?

2010-01-01 Thread David Bovill
2009/12/31 Jim Ault 

>   --// 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 = " hello world "
>

How about something like:

local someHtml = {
>  hello world 
> }
>


This would then allow doing things like:

local someHtml = {
> It is 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 = "
>  hello world 
> "
>

or to use C style quotes:

local someHtml = /*
>  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")
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution