sorting algorithms

2017-06-29 Thread Mark Wieder via use-livecode
Fascinating youtube video demonstrating 15 sorting algorithms visually 
and sonically.


https://boingboing.net/2017/06/28/15-sorting-algorithms-visualiz.html

--
 Mark Wieder
 ahsoftw...@gmail.com

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


Re: Shell - c Full Example

2017-06-29 Thread JB via use-livecode
Thanks for the code tip, Mark.

JB


> On Jun 29, 2017, at 8:20 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 06/29/2017 07:40 PM, JB via use-livecode wrote:
> 
>> char* getReverse(char const str[]){
>> static int i=0;
>> static char rev[MAX];
>>  if(*str){
>> getReverse(str+1);
>> rev[i++] = *str;
>> }
>>  return rev;
>> }
> 
> Nice use of recursion, but note that you're susceptible to buffer overflow if 
> you don't limit str to MAX-1 chars. And rev should be null-terminated.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


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


Re: Shell - c Full Example

2017-06-29 Thread Mark Wieder via use-livecode

On 06/29/2017 07:40 PM, JB via use-livecode wrote:


char* getReverse(char const str[]){
 static int i=0;
 static char rev[MAX];
 
 if(*str){

 getReverse(str+1);
 rev[i++] = *str;
 }
 
 return rev;

}


Nice use of recursion, but note that you're susceptible to buffer 
overflow if you don't limit str to MAX-1 chars. And rev should be 
null-terminated.


--
 Mark Wieder
 ahsoftw...@gmail.com


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


Shell - c Full Example

2017-06-29 Thread JB via use-livecode
The following shows you how to compile c code
from the terminal and run it in Livecode.

1.  Open a text editor and paste the following
c code;


#include
#define MAX 100
char* getReverse(char const []);

int main(int argc, const char * argv[]) {

char *rev;
char const *str = argv[1];

if (argc != 2)
{
printf("Enter 1 arguments and try again.\n");
return 1;
}

rev = getReverse(str);
printf("%s\n",rev);

return 0;
}


char* getReverse(char const str[]){
static int i=0;
static char rev[MAX];

if(*str){
getReverse(str+1);
rev[i++] = *str;
}

return rev;
}


Save the above code on the desktop as stringR.c


2.  Open the terminal and type the following;

cd ~/Desktop
gcc -o stringR stringR.c

The compiled code should be on your desktop now.

3.  Open Livecode and paste the following into a button.
Make sure you have a field as shown below.

on mouseUp
   set the defaultFolder to "~/Desktop"
   put quote & ".detrela erew sgod gniffins bmob yhw wenk snruB & stnaR oidar 
ORIK elttaeS ylno ... ...gof eht ni god eht gniklaw saw ehS" & quote into tFILE1
   put shell( "./stringR" && tFILE1) into pData
   put pData into fld id 
   beep 2
end mouseUp

enjoy,
JB


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


Google Static Maps Problem

2017-06-29 Thread William Prothero via use-livecode
Folks:
I’ve found a way to display an image of a google static map, in my app. It’s 
quite easy and well-documented. However, I need to get the lat and lon values 
of the corners of the map, at the displayed zoom level. There is a 
simple-looking javascript example for doing this at:
https://stackoverflow.com/questions/12507274/how-to-get-bounds-of-a-google-static-map
 

My javascript knowledge is totally minimal and I am loath to learn javascript 
just to get this one handler into livecode script.

What I have is an application that plots geophysical data on a world map. The 
map kind of ugly at very high magnifications and I thought the google map would 
give me a nice map image, with a wider range of magnifications, and minimize 
local storage space. What I will do is display the map image (centered on a 
particular lat/lon and magnification) in a rectangle, then take a snapshot, 
then copy my data symbols and images into the resulting snapshot. This works 
very will with my current map. I know that I can draw symbols directly on a 
google map using the map api, but it will be much more direct, and build on 
existing code, if I do it as described.

So if anyone who is familiar with javascript has a few moments to give me some 
pointers on how I might convert this to LCS, I’d very much appreciate it. What 
I’m scratching my head over is how to access the parameters from the Google API 
to do the needed calculations. The link above is to the javascript example.

Thanks in advance,
Bill P

William A. Prothero
http://earthlearningsolution.org/

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

Re: Levure wiki / documentation

2017-06-29 Thread Andre Garzia via use-livecode
It is talking longer than I wanted because I am building the whole system
and that takes time :-)

I should have just signed up for a teachable account but I wanted to own
the system, so, right now I am finishing the content and infrastructure.

On Thu, Jun 29, 2017 at 7:41 PM, Andre Garzia  wrote:

> Hi Lagi,
>
> Actually, I am reworking the material into an online course, should launch
> as a beta shortly. Doing it online allows me to iterate the material and
> offer more compelling content than using the old system.
>
> :D
>
> On Tue, Jun 27, 2017 at 8:50 AM, Lagi Pittas via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Andre how do we get your book(s) somebody on here posted that he had the
>> book that is still showing 80% done on leanpub
>>
>> KIndest Regards Lagi
>>
>> On 27 June 2017 at 00:20, Andre Garzia via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>
>> > Alex,
>> >
>> > I am not Trevor so he may suggest something different but usually when
>> > dealing with github hosted projects, we use the issue system available
>> on
>> > each repository. Ideally, you submit a new issue per "thing" instead of
>> > doing a single new issue with many things inside.
>> >
>> > Cheers
>> > andre
>> >
>> > On Mon, Jun 26, 2017 at 8:13 PM, Alex Tweedly via use-livecode <
>> > use-livecode@lists.runrev.com> wrote:
>> >
>> > > I've got as far as building my app with within the framework, and
>> reading
>> > > much of the docs.
>> > >
>> > > I've found some things that I believe should change in the wiki - both
>> > >
>> > >  - just obvious bugs / typos / cleanup
>> > >
>> > > and
>> > >
>> > >  - things I think I know how to correct, but not 100% sure, and would
>> > like
>> > > confirmation to be sure I am understanding properly.
>> > >
>> > > As a git/github newbie - how do I go about suggesting changes to the
>> > docs ?
>> > >
>> > > Thanks
>> > >
>> > > Alex.
>> > >
>> > >
>> > >
>> > > ___
>> > > use-livecode mailing list
>> > > use-livecode@lists.runrev.com
>> > > Please visit this url to subscribe, unsubscribe and manage your
>> > > subscription preferences:
>> > > http://lists.runrev.com/mailman/listinfo/use-livecode
>> > >
>> >
>> >
>> >
>> > --
>> > http://www.andregarzia.com -- All We Do Is Code.
>> > http://fon.nu -- minimalist url shortening service.
>> > ___
>> > use-livecode mailing list
>> > use-livecode@lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
> --
> http://www.andregarzia.com -- All We Do Is Code.
> http://fon.nu -- minimalist url shortening service.
>



-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Levure wiki / documentation

2017-06-29 Thread Andre Garzia via use-livecode
Hi Lagi,

Actually, I am reworking the material into an online course, should launch
as a beta shortly. Doing it online allows me to iterate the material and
offer more compelling content than using the old system.

:D

On Tue, Jun 27, 2017 at 8:50 AM, Lagi Pittas via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Andre how do we get your book(s) somebody on here posted that he had the
> book that is still showing 80% done on leanpub
>
> KIndest Regards Lagi
>
> On 27 June 2017 at 00:20, Andre Garzia via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Alex,
> >
> > I am not Trevor so he may suggest something different but usually when
> > dealing with github hosted projects, we use the issue system available on
> > each repository. Ideally, you submit a new issue per "thing" instead of
> > doing a single new issue with many things inside.
> >
> > Cheers
> > andre
> >
> > On Mon, Jun 26, 2017 at 8:13 PM, Alex Tweedly via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> > > I've got as far as building my app with within the framework, and
> reading
> > > much of the docs.
> > >
> > > I've found some things that I believe should change in the wiki - both
> > >
> > >  - just obvious bugs / typos / cleanup
> > >
> > > and
> > >
> > >  - things I think I know how to correct, but not 100% sure, and would
> > like
> > > confirmation to be sure I am understanding properly.
> > >
> > > As a git/github newbie - how do I go about suggesting changes to the
> > docs ?
> > >
> > > Thanks
> > >
> > > Alex.
> > >
> > >
> > >
> > > ___
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> >
> >
> >
> > --
> > http://www.andregarzia.com -- All We Do Is Code.
> > http://fon.nu -- minimalist url shortening service.
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: synonyms

2017-06-29 Thread Bob Sneidar via use-livecode
Wait I think that is what the Tree View (however imperfectly) works. 

Bob S


> On Jun 29, 2017, at 13:44 , Bob Sneidar via use-livecode 
>  wrote:
> 
> I thought it was about making the engine do it. Still, I take your point that 
> many arguments will require a lot more typing. If it's that much of a chore, 
> how about an array building pallet stack, where you type an array name, a 
> series of keyname/value/hit enter sequences and it builds the code for you? 
> Even less typing. 
> 
> Bob S


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


Re: synonyms

2017-06-29 Thread Bob Sneidar via use-livecode
I thought it was about making the engine do it. Still, I take your point that 
many arguments will require a lot more typing. If it's that much of a chore, 
how about an array building pallet stack, where you type an array name, a 
series of keyname/value/hit enter sequences and it builds the code for you? 
Even less typing. 

Bob S


> On Jun 29, 2017, at 13:00 , Richard Gaskin via use-livecode 
>  wrote:
> 
> > If it's that big a deal someone could write a function that takes
> > doSomething type="chart"  size="100"
> > and converts it
> 
> That's pretty much what this thread is about.


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


Re: Table Fields "and all"

2017-06-29 Thread Bob Sneidar via use-livecode
Which is to say, "I think. Therefore... I have no idea what the hell that 
means." ;-)

Bob S


> On Jun 29, 2017, at 12:51 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> Um:
> 
> http://www.bbc.com/news/health-39518580
> 
> "So the prevailing idea was that memories are formed in the hippocampus and 
> then moved to the cortex where they are "banked".
> 
> The team at the Riken-MIT Center for Neural Circuit Genetics have done 
> something mind-bogglingly advanced to show this is not the case."
> 
> Richmond.


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


Re: synonyms

2017-06-29 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> On Jun 29, 2017, at 10:33 , Richard Gaskin wrote:
>>
>> > put "chart" into tType
>> > put "100" into tSize
>> > doSomething tType, tSize
>>
>> That's not a one-liner.  That's three lines.  :)
>>
>> The call itself is indeed only one line, but to prep the args for the
>> call requires as many additional lines as there are args.
...
> put "chart" into tType ; put "100" into tSize ; doSomething tType,
> tSize
>
> That is a one liner too.

Not in this context.  In programming, a "line" is generally understood 
to be referring to a statement.  Whether the statements are separated by 
0x10 or 0x59 is less the point than that a lot more typing is happening.


> So what? Are we averse to carriage returns?

No, just typing in general. :)

The array example about is about 70 keystrokes, while this:

  doSomething type="chart" size="100"

...is about half as many.

With just two args it doesn't matter much.

But once we start looking at the scope of args supported by rich 
functions like R's plot command or Hugh Senior's great ChartMaker the 
additional typing can add up very significantly.



> If it's that big a deal someone could write a function that takes
> doSomething type="chart"  size="100"
> and converts it

That's pretty much what this thread is about.


> to:
> doSomething put "chart" into type ; put "100" into size ; doSomething
> type, size
> and then replaces it in your script editor with a hotkey. I just think
> the whole thing is majoring in the minors.

Preprocessing. I like it. Could be good.  Let's call that Option 5. :)


> I suppose lots of things are possible in other languages. Are we
> trying to be just like all the other languages?

Like I said, I'm not at all married to the idea of having named params 
in LC.  If Mark Waddingham were to show up here and say, "I changed my 
mind, let's do it!" I'd happily use them, but I've gotten along well 
enough without them all these years that their absence isn't stopping me 
from shipping anything.


What I find interesting about this thread is discovering the range of 
use cases others have in mind for named param.  All this time I thought 
I was alone in finding them useful.  Good ideas have shown up here.


Whether named params or something else, personally I'm glad the language 
grows with new features from time to time.


Those of us using xTalks from the beginning remember that we spent about 
half our working lives without arrays, and had to wait nearly half a 
decade for SuperCard to deliver the first xTalk implementation of custom 
properties.


Today, I can't imagine trying to get my work done without either of those.

Sometimes even sprawling discussions like this one give rise to ideas 
that later become valuable features.


Other times they become useful libraries, or additions to Master Library.

And sometimes it's just entertainment.

But there are worse ways to enjoy oneself than to explore new directions 
in scripting language design among friends.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com



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


Release 9.0.0 DP7 / SVG / The book of the film of the poem

2017-06-29 Thread Alejandro Tejada via use-livecode
Hi Franz,

I found a temporal solution for a limitation that you found
in the SVG MultiColor widget.

Looks like every vector path rendered in this SVG MultiColor
widget could have a fill or a stroke, but not both. If a path
have a fill color, the stroke is not rendered.

The workaround for this limitation is to duplicate those few
paths that have a non empty fill and a stroke and change
the fill atribute of duplicated line to fill:none

In the sample svg file that you posted, there are only 7 paths
that you must duplicate and replace the fill atribute to fill:none

path d="M93.86,48.612C93.86...
path d="M66.405,228.331C66.751...
path d="M30.188,194.513C30.188...
path d="M30.354,51.441C30.354...
path d="M33.794,64.434C33.794...
path d="M97.419,64.848C97.419...
path d="M93.86,48.612C93.86...

Duplicating these very few lines in every svg file is
the easiest and fastest way to jump over this
limitation (until a new version of SVG Multicolor
widget is released). It's relatively easy to create
a Livecode script that automate this task, but
someone in your team should verify that both
svg files (original svg and modified svg for importing
into LiveCode) are visually identical.

In a previous message, you wrote that you have
thousands of files to import into a Livecode app.
This is the reason why I took a closer look at it.

By the way, are you compressing these SVG
paths data before using them inside widgets?
Probably, you could reduce a lot the size of your app
if you compress this SVG path data.

Also, I noticed that your SVG path data uses
3 decimal points (like 51.088)
Please, check if changing for 2 decimal points
(like 51.09) do not change too much the
appearance of your files.

Tell us if this advice works fine in your own project.
You will be saving a lot of time for others that find
these same problems.

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


Re: Table Fields "and all"

2017-06-29 Thread Richmond Mathewson via use-livecode

Um:

http://www.bbc.com/news/health-39518580

"So the prevailing idea was that memories are formed in the hippocampus 
and then moved to the cortex where they are "banked".


The team at the Riken-MIT Center for Neural Circuit Genetics have done 
something mind-bogglingly advanced to show this is not the case."


Richmond.


On 6/29/17 10:42 pm, Tore Nilsen via use-livecode wrote:



29. jun. 2017 kl. 21:29 skrev Richard Gaskin via use-livecode 
:

hh wrote:

RG wrote:
The human mind can generally hold between three and seven things in
conscious memory at any given time.

How did you measure that?

Good question.  It's been so long since I took that cog psy class back in 
college that I'd have to dig up my old text books to describe the details of 
the study that led to that widely-cited rubric.


You will find some information on short term memory here: 
https://www.simplypsychology.org/short-term-memory.html 

See also the references in this article. There seems to be universal agreement 
about the validity of the theory, at least among educators.

Regards
Tore Nilsen


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


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


Re: Printing a Widget Browser

2017-06-29 Thread Jonathan Lynch via use-livecode
Also, have you tried this:

Do "window.print()" in widget "my widget"

Sent from my iPhone

> On Jun 29, 2017, at 3:37 PM, jonathandly...@gmail.com wrote:
> 
> Could you export to a file, launch that in the user's standard browser, and 
> print from there?
> 
> Sent from my iPhone
> 
>> On Jun 29, 2017, at 2:04 PM, Terence Heaford via use-livecode 
>>  wrote:
>> 
>> 
>> Not posted for a long time but still keeping an eye on progress.
>> 
>> Is there any chance of printing a Browser Widget any time soon?
>> 
>> This code just gives a grey printout.
>> 
>> I am waiting patiently for this so that I can use for example amCharts 
>> within LiveCode.
>> 
>> I have implemented a print routine by exporting to an image but as this is 
>> an image it can turn out blurred.
>> 
>> Thanks
>> 
>> Terry
>> 
>> 
>> on mouseUp
>> 
>>  answer page setup --as sheet
>>  if the result = "cancel" then
>> exit mouseUp
>>  end if
>>  answer printer --as sheet
>>  if the result = "cancel" then
>> exit mouseUp
>>  end if
>> 
>>  put  the printPaperRectangle into tPaperRect
>>  put item 3 of tPaperRect into tAvailWidth
>>  put item 4 of tPaperRect into tAvailHeight
>> 
>>  put the width of widget "Browser" into tChartWidth
>>  put the height of widget "Browser" into tChartHeight
>> 
>>  put tAvailWidth/tChartWidth into tWidthRatio   
>>  put tAvailHeight/tChartHeight into tHeightRatio   
>>  put min(tWidthRatio,tHeightRatio) into tRatio   
>> 
>>  put tRatio * tChartWidth into tPrintWidth
>>  put tRatio * tChartHeight into tPrintHeight
>> 
>>  put 0 into item 1 of tPrintRect
>>  put 0 into item 2 of tPrintRect
>>  put tPrintWidth into item 3 of tPrintRect
>>  put tPrintHeight into item 4 of tPrintRect
>> 
>>  print card from topleft of widget "Browser" to bottomRight of widget 
>> "Browser" into tPrintRect
>> 
>> 
>> end mouseUp
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: Table Fields "and all"

2017-06-29 Thread Tore Nilsen via use-livecode


> 29. jun. 2017 kl. 21:29 skrev Richard Gaskin via use-livecode 
> :
> 
> hh wrote:
> >> RG wrote:
> >> The human mind can generally hold between three and seven things in
> >> conscious memory at any given time.
> >
> > How did you measure that?
> 
> Good question.  It's been so long since I took that cog psy class back in 
> college that I'd have to dig up my old text books to describe the details of 
> the study that led to that widely-cited rubric.


You will find some information on short term memory here: 
https://www.simplypsychology.org/short-term-memory.html 

See also the references in this article. There seems to be universal agreement 
about the validity of the theory, at least among educators. 

Regards
Tore Nilsen


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


aborting on wait with messages?

2017-06-29 Thread Dr. Hawkins via use-livecode
In my startup routines (which, admittedly are complex and modify stacks), I
have a routine which gets called, puts empty into a pair of global arrays
it is about to build or rebuild, and then a "wait 0 with messages"

It stops at the wait with "button "src_mcp": execution error at line 1535
(wait: aborted), char 1"

In normal use, this is simply a crude "parallelization" which lets other
things happen, such as the splash screen.

Zs I'm writing, it occurs to me:  could this possibly be because the
calling stack has been saved with a new name?  (this only seems to happen
when it detects the date at stack version name don't match, and
automatically reversions [i.e., the first time I open in the IDE on any
given day])
-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Printing a Widget Browser

2017-06-29 Thread Jonathan Lynch via use-livecode
Could you export to a file, launch that in the user's standard browser, and 
print from there?

Sent from my iPhone

> On Jun 29, 2017, at 2:04 PM, Terence Heaford via use-livecode 
>  wrote:
> 
> 
> Not posted for a long time but still keeping an eye on progress.
> 
> Is there any chance of printing a Browser Widget any time soon?
> 
> This code just gives a grey printout.
> 
> I am waiting patiently for this so that I can use for example amCharts within 
> LiveCode.
> 
> I have implemented a print routine by exporting to an image but as this is an 
> image it can turn out blurred.
> 
> Thanks
> 
> Terry
> 
> 
> on mouseUp
> 
>   answer page setup --as sheet
>   if the result = "cancel" then
>  exit mouseUp
>   end if
>   answer printer --as sheet
>   if the result = "cancel" then
>  exit mouseUp
>   end if
> 
>   put  the printPaperRectangle into tPaperRect
>   put item 3 of tPaperRect into tAvailWidth
>   put item 4 of tPaperRect into tAvailHeight
> 
>   put the width of widget "Browser" into tChartWidth
>   put the height of widget "Browser" into tChartHeight
> 
>   put tAvailWidth/tChartWidth into tWidthRatio   
>   put tAvailHeight/tChartHeight into tHeightRatio   
>   put min(tWidthRatio,tHeightRatio) into tRatio   
> 
>   put tRatio * tChartWidth into tPrintWidth
>   put tRatio * tChartHeight into tPrintHeight
> 
>   put 0 into item 1 of tPrintRect
>   put 0 into item 2 of tPrintRect
>   put tPrintWidth into item 3 of tPrintRect
>   put tPrintHeight into item 4 of tPrintRect
> 
>   print card from topleft of widget "Browser" to bottomRight of widget 
> "Browser" into tPrintRect
> 
> 
> end mouseUp
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: Table Fields "and all"

2017-06-29 Thread Richard Gaskin via use-livecode

hh wrote:
>> RG wrote:
>> The human mind can generally hold between three and seven things in
>> conscious memory at any given time.
>
> How did you measure that?

Good question.  It's been so long since I took that cog psy class back 
in college that I'd have to dig up my old text books to describe the 
details of the study that led to that widely-cited rubric.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

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


Re: synonyms

2017-06-29 Thread Mark Wieder via use-livecode

On 06/29/2017 09:57 AM, Alex Tweedly via use-livecode wrote:

Mark,

are you trying to allow mixing of positional and named actual parameters ?


Exactly.



In your example, is "This is a chart" the actual parameter for the first 
or second positional parameter ?


Would it not be less confusing to expect (as Python does) that non-named 
parameters must come first in the actual usage, so they can be 
unambiguously allocated to the correct parameter place ?


[  i.e. SyntaxError: non-keyword arg after keyword arg ]


Don't know about the 'less confusing' part, but otherwise ruby lets you 
interleave them: if there's an associated name with a parameter then 
that parameter gets assigned to that variable. Otherwise you have to 
work with the parameter position, which IMO is less intuitive, more 
error-prone, and harder to read and maintain. I wouldn't object to using 
python's restriction, but I don't think it's necessary. Given that 
parameters are comma-separated, it's a simple change to the script 
parser to allow this (not that I expect this will ever happen).


--
 Mark Wieder
 ahsoftw...@gmail.com

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


Re: synonyms

2017-06-29 Thread Alex Tweedly via use-livecode



On 29/06/2017 19:11, Bob Sneidar via use-livecode wrote:



That's possible in R, Python, CSS, and others, but not natively in LC.

I suppose lots of things are possible in other languages. Are we trying to be 
just like all the other languages?

No. What we should be trying to do is pick out the best, worthwhile 
features of other languages and see if they fit comfortably within LC.


One aspect of that is whether they will be either confusing to, or be 
sadly missed by, many potential LC converts. So the fact that this 
feature (with variations) occurs in so many other, popular languages is 
relevant - it makes it, IMHO, unlikely they will be confusing to very 
many people coming to LC from other (modern) language backgrounds, and 
it also means they will be missed by many.


Even other languages not in the above list (e.g. Perl) which do *not* 
have named parameters (or keyword args, or ...) do have simple, commonly 
used ways round it - Perl passes arguments as a dictionary (i.e. an 
array in LC terms), and has a simple, clean, succinct way to fill it 
that dictionary either in, or immediately prior to, the function call.  
So the benefits of the mechanism are known to even more people who 
already program in a modern language.



-- Alex.


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


Re: Table Fields "and all"

2017-06-29 Thread Bob Sneidar via use-livecode
He doesn't remember. He has 8 other things on his mind. 

Bob S


> On Jun 29, 2017, at 10:49 , hh via use-livecode 
>  wrote:
> 
>> RG wrote:
>> The human mind can generally hold between three and seven things in
>> conscious memory at any given time.
> 
> How did you measure that?


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


Re: Table Fields "and all"

2017-06-29 Thread Richmond Mathewson via use-livecode

Personally I always take a ruler to bed to:

1. measure how long I sleep.

2. To find out what a night of passion with a crowned head is like.

Richmond.

On 6/29/17 8:49 pm, hh via use-livecode wrote:

RG wrote:
The human mind can generally hold between three and seven things in
conscious memory at any given time.

How did you measure that?

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


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


Re: synonyms

2017-06-29 Thread Bob Sneidar via use-livecode
put "chart" into tType ; put "100" into tSize ; doSomething tType, tSize

That is a one liner too. So what? Are we averse to carriage returns? If it's 
that big a deal someone could write a function that takes
> doSomething type="chart"  size="100"
and converts it to:
> doSomething put "chart" into type ; put "100" into size ; doSomething type, 
> size

and then replaces it in your script editor with a hotkey. I just think the 
whole thing is majoring in the minors. 

> That's possible in R, Python, CSS, and others, but not natively in LC.

I suppose lots of things are possible in other languages. Are we trying to be 
just like all the other languages? 

Bob S



> On Jun 29, 2017, at 10:33 , Richard Gaskin via use-livecode 
>  wrote:
> 
> > put "chart" into tType
> > put "100" into tSize
> > doSomething tType, tSize
> 
> That's not a one-liner.  That's three lines.  :)
> 
> The call itself is indeed only one line, but to prep the args for the call 
> requires as many additional lines as there are args.
> 
> This is a one-linter:
> 
>  doSomething type="chart"  size="100"
> 
> That's possible in R, Python, CSS, and others, but not natively in LC.
> 
> -- 
> Richard Gaskin


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


Printing a Widget Browser

2017-06-29 Thread Terence Heaford via use-livecode

Not posted for a long time but still keeping an eye on progress.

Is there any chance of printing a Browser Widget any time soon?

This code just gives a grey printout.

I am waiting patiently for this so that I can use for example amCharts within 
LiveCode.

I have implemented a print routine by exporting to an image but as this is an 
image it can turn out blurred.

Thanks

Terry


on mouseUp
   
   answer page setup --as sheet
   if the result = "cancel" then
  exit mouseUp
   end if
   answer printer --as sheet
   if the result = "cancel" then
  exit mouseUp
   end if
   
   put  the printPaperRectangle into tPaperRect
   put item 3 of tPaperRect into tAvailWidth
   put item 4 of tPaperRect into tAvailHeight
   
   put the width of widget "Browser" into tChartWidth
   put the height of widget "Browser" into tChartHeight
   
   put tAvailWidth/tChartWidth into tWidthRatio   
   put tAvailHeight/tChartHeight into tHeightRatio   
   put min(tWidthRatio,tHeightRatio) into tRatio   
   
   put tRatio * tChartWidth into tPrintWidth
   put tRatio * tChartHeight into tPrintHeight
   
   put 0 into item 1 of tPrintRect
   put 0 into item 2 of tPrintRect
   put tPrintWidth into item 3 of tPrintRect
   put tPrintHeight into item 4 of tPrintRect
   
   print card from topleft of widget "Browser" to bottomRight of widget 
"Browser" into tPrintRect
   
   
end mouseUp
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Table Fields "and all"

2017-06-29 Thread hh via use-livecode
> RG wrote:
> The human mind can generally hold between three and seven things in
> conscious memory at any given time.

How did you measure that?

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


Re: synonyms

2017-06-29 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> Sorry, I simply do not see any advantage to this, other than making a
> one liner to pass data to a command or function.
>
> put "chart" into tType
> put "100" into tSize
> doSomething tType, tSize

That's not a one-liner.  That's three lines.  :)

The call itself is indeed only one line, but to prep the args for the 
call requires as many additional lines as there are args.


This is a one-linter:

  doSomething type="chart"  size="100"

That's possible in R, Python, CSS, and others, but not natively in LC.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

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


Re: Table Fields "and all"

2017-06-29 Thread Richard Gaskin via use-livecode

Richmond Mathewson wrote:

> On 6/29/17 11:13 am, Lagi Pittas wrote:
>> I had the same problem when I started using Tables and after I
>> found the TAB delimiter "trick" as per Hermann, it was obvious
>> (20/20 Hind sight).
>> The Aha! moment came when using commas messed it up by putting them
>> all in 1 column with the commas intact. I just assumed everybody
>>  knew  and I was a slow learner- nice to know I was not alone
>
> One of the reasons you may not be alone is because the documentation
> is not much good when it comes to table fields.
>
> I have my suspicions that they have been overlooked; possibly in the
> mad rush towards datagrids.

Table fields were introduced at least by the mid-90s, possibly as early 
as '92 when the MetaCard/LiveCode engine was born.  The DataGrid is much 
newer.  There was no "rush towards datagrids".


What Lagi experienced is how people learn.

The human mind can generally hold between three and seven things in 
conscious memory at any given time.  The User Guide is 627 pages long.


Whether we're learning basketball, piano, or programming, there is no 
book one can read and then expect to be immediately good at the craft.


People learn by practice.  Practice is the art of learning from mistakes.

The value judgment that mistakes are somehow "wrong" or someone else's 
fault or anyone's fault at all is probably the biggest impediment to 
learning I've ever known.


Imperfect performance, in any human endeavor, is simply how we learn to 
move ever closer toward perfection, a journey that moves forward as 
quickly as the number of hours we devote to practice.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

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


Re: How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-29 Thread Richard Gaskin via use-livecode

Sannyasin Brahmanathaswami wrote:

> But that it would be nice not be "stuck" with only finding out the
> properties of the variable as a variable.
>
> i.e. pField is a variable with 1 line…
>
> but  to be able to address the properties of the object referred to by
> a variable containing the long ID of an object/
>
> How do we do that?

By addressing properties using property syntax.

A field is an object; the text of a field is a property of the object.

If you adopt a habit of referring to properties using property syntax 
the ambiguity goes away, e.g.:


   get line 2 of the text of pField

How did we get to this "sometimes" rule, where referring to an object 
sometimes refers to the object itself and other times refers to one 
specific property of the object, its text?


Thank the mother tongue, HyperTalk.  For reasons not entirely unsound 
for an authoring system, they recognized that a field's text property is 
the most commonly accessed property.  So to provide a certain level of 
syntactic simplicity they allowed us to use an object reference in cases 
where what we really mean is the value of that one property of the object:


   put field 1 + field 2 into field 3

..is certainly more fun to write than:

  set the text of field 3 to the text of field 1 + the text of field 2

Seems so natural to use the shorter form, and indeed that first line 
above is included in my introductory lesson when I teach this family of 
languages.


But that syntactic simplicity comes at a cost.  Everything in an 
imperfect universe involves trade-offs; nothing is a magic pony.  Here 
the trade-off for syntactic simplicity is cognitive load down the road 
from the ambiguity introduced by this implicit property access.


It causes confusion for even folks who've been scripting in these 
languages for decades, evidenced in this thread. :)


So very soon after the seductive quality of referring to a field's text 
property by using a reference to the field object has the learner 
hooked, I introduce the text property, along with other properties, and 
suggest using property syntax where practical, esp. when the object 
reference is in a variable*.


Yes, the rules that distinguish when an object reference will actually 
refer to the object and when an object reference will implicitly refer 
to the value of one specific property of the object are knowable, likely 
documented, and ultimately teachable.


But all these years later it still causes confusion now and then, so I 
try to avoid the ambiguity with a habit of referring to the text 
property using the same syntax I'm expected to use for any other 
property, at least when the object reference is in a variable.


When using a hard-wired object reference it rarely matters at all.  But 
the moment I'm referring to an object in a variable, I either need to 
remain mindful of the implications of this language ambiguity or simply 
stick to the pattern of referring to object properties using property 
syntax.




* Insanely OCD tidbit:  Most of the time when I store an object 
reference in a variable I do so using the object's long ID.  It's 
absolute and unambiguous, and doing that consistently means I don't need 
to think as much.


To remind myself that I'm using the long ID, I've adopted a habit of 
using the variable name tObj.  I use it a lot, and it's short so it's 
easy to type.


This distinguishes it from those exceptional cases where I might use 
just the short name of an object, like a field name, where I'll use 
something like tFieldName.  With that, years later I can readily see 
that it's not how I most commonly do things, and describes the form the 
variable contains within the variable name.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

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

Re: synonyms

2017-06-29 Thread Alex Tweedly via use-livecode

Mark,

are you trying to allow mixing of positional and named actual parameters ?

In your example, is "This is a chart" the actual parameter for the first 
or second positional parameter ?


Would it not be less confusing to expect (as Python does) that non-named 
parameters must come first in the actual usage, so they can be 
unambiguously allocated to the correct parameter place ?


[  i.e. SyntaxError: non-keyword arg after keyword arg ]

-- Alex.


On 29/06/2017 17:19, Mark Wieder via use-livecode wrote:

On 06/28/2017 08:55 AM, Richard Gaskin via use-livecode wrote:


 > Even better.
 >
 > You solution illustrate more so than mine how easy it is to make
 > handler and functions that use name/value pairs if someone prefers
 > that model. The xtalk language really doesn't need any extensions
 > or enhancements to enable this.


I think if the loophole of allowing space-separated parameters were 
fixed then the following syntax might work, thus allowing the engine's 
parser to differentiate between named parameters and otherwise (the 
following would be four parameters, two of them named):


DoSomething name: "my chart", "This is a chart", width: 100, pArray




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


Re: synonyms

2017-06-29 Thread Alex Tweedly via use-livecode


On 29/06/2017 17:43, Mike Bonner via use-livecode wrote:

yeah, that was kinda my point.  It bipasses the need to jump through all
the hoops of building up the proper string, then having to break it into
parts on the other end.  My earlier example (way over simplified) ended up
using split create an array out of name value pairs.. It just makes more
sense to me, to pass in the array to begin with.

Having said that, building such a string could be simplified using merge..
doSomething 12,4, merge("size=[[tsize]],row=[[gAData]]")

??
[[gAData]] is still not convertable to a string, so I don't see how that 
could work.


But who cares :-) ?

For some cases - basically simpler ones - the string parsing works 
nicely, though it can be a bit untidy when you are passing variables.


For 98% of the others, an array of named/optional parameters works well 
(and you can use tricks/functions to make that less verbose).


doSomething 12, 4, _("size", tSize, row, gAData)
 works well for me, is probably anathema to some (many?) others

and for the last 2% where you want named, optional, pass-by-reference 
parameters - you're out of luck,  maybe LCB will help some day.


-- Alex.


But again, you either do the work first (and build the array to send)  or
you do the work after (and break up the name value pairs after the fact.)
  It just seems simpler to me to use arrays from the start.

On Thu, Jun 29, 2017 at 10:31 AM, Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:


On 29/06/2017 17:17, Mike Bonner via use-livecode wrote:


The thing about passing in as an array is.. its just a different form of
name value pairs, so it sidesteps the whole issue.
alue pairs.


Not quite - there's a crucial difference.

Using an array for name/value pairs, you can pass in an array as an actual
parameter.

You can't do that with strings for the name/value pairs.

put gAData into tA["row"]
put 100 into tA["size"]
DoSomething 12, 4, tA

but you can't do
DoSomething 12, 4, "size=100", "row=" & gAData
because the array gAData can't be automatically converted to/from a string
to pass it.

-- Alex.


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


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



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


Re: Sharp as a pound (was Array assignment...)

2017-06-29 Thread Bob Sneidar via use-livecode
Point taken. When communicating, we never really listen to what is being said, 
but rather to what is likely meant. This can cause confusion sometimes, but the 
obvious advantage is that we get on with minimal fuss. Computer languages don't 
tolerate such things, unless you program them to. Hence the concept of 
synonyms. 

So long as we all generally agree that "#" can be called "pound, Hash or Sharp" 
(not so sure I agree with the last one btw) then we can talk about it. So far 
as the computer is concerned, it's ascii(035) and even that is a synonym for 
00100010. 

Bob S


> On Jun 29, 2017, at 03:37 , james--- via use-livecode 
>  wrote:
> 
> Craig wrote:
>> So do we in the US, though sometimes the word "hash" has been seen to creep
>> about.
> 
> Now you mention it I use this too.
> Seems we can internally hold multiple synonyms without even realizing that is 
> what we are doing.


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


Re: synonyms

2017-06-29 Thread Mike Bonner via use-livecode
yeah, that was kinda my point.  It bipasses the need to jump through all
the hoops of building up the proper string, then having to break it into
parts on the other end.  My earlier example (way over simplified) ended up
using split create an array out of name value pairs.. It just makes more
sense to me, to pass in the array to begin with.

Having said that, building such a string could be simplified using merge..
doSomething 12,4, merge("size=[[tsize]],row=[[gAData]]")

But again, you either do the work first (and build the array to send)  or
you do the work after (and break up the name value pairs after the fact.)
 It just seems simpler to me to use arrays from the start.

On Thu, Jun 29, 2017 at 10:31 AM, Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 29/06/2017 17:17, Mike Bonner via use-livecode wrote:
>
>> The thing about passing in as an array is.. its just a different form of
>> name value pairs, so it sidesteps the whole issue.
>> alue pairs.
>>
>
> Not quite - there's a crucial difference.
>
> Using an array for name/value pairs, you can pass in an array as an actual
> parameter.
>
> You can't do that with strings for the name/value pairs.
>
>put gAData into tA["row"]
>put 100 into tA["size"]
>DoSomething 12, 4, tA
>
> but you can't do
>DoSomething 12, 4, "size=100", "row=" & gAData
> because the array gAData can't be automatically converted to/from a string
> to pass it.
>
> -- Alex.
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: synonyms

2017-06-29 Thread Alex Tweedly via use-livecode

On 29/06/2017 17:17, Mike Bonner via use-livecode wrote:

The thing about passing in as an array is.. its just a different form of
name value pairs, so it sidesteps the whole issue.
alue pairs.


Not quite - there's a crucial difference.

Using an array for name/value pairs, you can pass in an array as an 
actual parameter.


You can't do that with strings for the name/value pairs.

   put gAData into tA["row"]
   put 100 into tA["size"]
   DoSomething 12, 4, tA

but you can't do
   DoSomething 12, 4, "size=100", "row=" & gAData
because the array gAData can't be automatically converted to/from a 
string to pass it.


-- Alex.


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


Re: synonyms

2017-06-29 Thread Mark Wieder via use-livecode

On 06/28/2017 08:55 AM, Richard Gaskin via use-livecode wrote:


 > Even better.
 >
 > You solution illustrate more so than mine how easy it is to make
 > handler and functions that use name/value pairs if someone prefers
 > that model. The xtalk language really doesn't need any extensions
 > or enhancements to enable this.


I think if the loophole of allowing space-separated parameters were 
fixed then the following syntax might work, thus allowing the engine's 
parser to differentiate between named parameters and otherwise (the 
following would be four parameters, two of them named):


DoSomething name: "my chart", "This is a chart", width: 100, pArray

--
 Mark Wieder
 ahsoftw...@gmail.com

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


Re: synonyms

2017-06-29 Thread Mike Bonner via use-livecode
The thing about passing in as an array is.. its just a different form of
name value pairs, so it sidesteps the whole issue.



On Thu, Jun 29, 2017 at 10:11 AM, Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

> No, what I meant was Richard's fourth method, described in
>
>
>> More with-the-grain would be this fourth option, passing in an array as
>> we see with some existing LC commands and functions, but that requires a
>> LOT more typing:
>>
>>   put "my chart" into tA["name"]
>>   put 100 into tA["width"]
>>   put "This is a chart" into tA["label"]
>>   DoSomething tA
>>
> As I said in the follow-up email (with changed subject line), I think that
> works perfectly, except it is rather verbose.
>
> -- Alex.
>
>
>
> On 29/06/2017 17:00, Bob Sneidar via use-livecode wrote:
>
>> I'm not sure what you mean by "pass by parameters" but I pass arrays by
>> parameters all the time. If you mean:
>>
>> function getSomeInfo @aMyArray
>> -- do some stuff
>> return true
>> end getSomeInfo
>>
>> That works fine.
>>
>> Bob S
>>
>>
>> On Jun 28, 2017, at 15:14 , Alex Tweedly via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
>>> He also mention a fourth method - using arrays - which he describes as
>>> "more with the grain" which is more appealing, since it solves all the
>>> above problems except the limitation on not using 'pass-by-reference'
>>> parameters. But I'll split that off to a separate response, with a changed
>>> subject/thread header.
>>>
>>> -- Alex.
>>>
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Array assignment / initialization [was Re: synonyms]

2017-06-29 Thread Mark Wieder via use-livecode

On 06/28/2017 03:32 PM, Alex Tweedly via use-livecode wrote:

Yes, it would be nice if we had an easier (terser) way to assign to an 
array. Maybe something like Python / Perl use to assign to a dictionary.


...and ruby. Let's not forget ruby. Ruby allows for

DoSomething name: "my chart", width: 100, label: "This is a chart", 
annaray: sAMine




put { "name": "my chart", "width": 100, "label": "This is a chart", 
"anarray": sAMine } into tA

DoSomething tA


LCB lets you do just that. And I'm promised that *someday* the LCB 
syntax will morph into the fabled Open Language project that's used as 
the excuse not to fix these anomalies.


--
 Mark Wieder
 ahsoftw...@gmail.com

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


Re: synonyms

2017-06-29 Thread Alex Tweedly via use-livecode

No, what I meant was Richard's fourth method, described in



More with-the-grain would be this fourth option, passing in an array 
as we see with some existing LC commands and functions, but that 
requires a LOT more typing:


  put "my chart" into tA["name"]
  put 100 into tA["width"]
  put "This is a chart" into tA["label"]
  DoSomething tA
As I said in the follow-up email (with changed subject line), I think 
that works perfectly, except it is rather verbose.


-- Alex.


On 29/06/2017 17:00, Bob Sneidar via use-livecode wrote:

I'm not sure what you mean by "pass by parameters" but I pass arrays by 
parameters all the time. If you mean:

function getSomeInfo @aMyArray
-- do some stuff
return true
end getSomeInfo

That works fine.

Bob S



On Jun 28, 2017, at 15:14 , Alex Tweedly via use-livecode 
 wrote:

He also mention a fourth method - using arrays - which he describes as "more with 
the grain" which is more appealing, since it solves all the above problems except 
the limitation on not using 'pass-by-reference' parameters. But I'll split that off to a 
separate response, with a changed subject/thread header.

-- Alex.


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



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


Re: synonyms

2017-06-29 Thread Bob Sneidar via use-livecode
Sorry, I simply do not see any advantage to this, other than making a one liner 
to pass data to a command or function. 

put "chart" into tType
put "100" into tSize
doSomething tType, tSize

What is the big deal? This can become:
put "chart" into tType ; put "100" into tSize ; doSomething tType, tSize

TADAAA! One liner. ;-)

Bob S



> On Jun 29, 2017, at 08:59 , Alex Tweedly via use-livecode 
>  wrote:
> 
> Yeah, so do I - that's why it's important to me :-).
> 
> But you can't do that using the "parameters as strings" techniques described 
> by Mike Bpnner and Paul Dupuis - i.e.
> 
>   DoSomething "type=chart", "size=100"
> 
> or
> 
>  DoSomething "type=chart, size=100"


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


Re: synonyms

2017-06-29 Thread Bob Sneidar via use-livecode
I'm not sure what you mean by "pass by parameters" but I pass arrays by 
parameters all the time. If you mean:

function getSomeInfo @aMyArray
   -- do some stuff
   return true
end getSomeInfo

That works fine. 

Bob S


> On Jun 28, 2017, at 15:14 , Alex Tweedly via use-livecode 
>  wrote:
> 
> He also mention a fourth method - using arrays - which he describes as "more 
> with the grain" which is more appealing, since it solves all the above 
> problems except the limitation on not using 'pass-by-reference' parameters. 
> But I'll split that off to a separate response, with a changed subject/thread 
> header.
> 
> -- Alex.


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


Re: synonyms

2017-06-29 Thread Alex Tweedly via use-livecode

Yeah, so do I - that's why it's important to me :-).

But you can't do that using the "parameters as strings" techniques 
described by Mike Bpnner and Paul Dupuis - i.e.


   DoSomething "type=chart", "size=100"

or

  DoSomething "type=chart, size=100"


Also, you can use the technique of using paramcount() and param(i) to 
pass a variable number of parameters - but you can't make those variable 
ones be passed by reference (unless I've missed something).


-- Alex.


On 29/06/2017 16:14, Mike Kerner via use-livecode wrote:

Alex,
I don't understand.  I pass arrays as parameters all the time, and I use
the pass by reference "@", too.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



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


Re: Table Fields "and all"

2017-06-29 Thread Bob Sneidar via use-livecode
First of all, tell me the bits of information are delimited by tabs or commas, 
otherwise I am going to go back and ask the source of that information to 
please provide it to me in a form I can use. If the only delimiter is spaces, 
and one of the bits of information has several words, then that is not a format 
anyone can write a program to deal with unless they already know that there are 
only 2 single word fields prior to the address, and only 3 single word fields 
after. If however there is a such thing as cities with more than one word, or 
someone decides to include a middle name, or someone's last name has more than 
one word, you are screwed. 

So this is not a good "example" to demonstrate anything except that there is a 
reason why delimited text is delimited in the first place. In fact, the whole 
reason you are trying to get this into a table field/object is so that the data 
can be managed in an orderly fashion. 

I understand that you don't want to dig through all the tools in your toolbox 
to get to the hammer, when that pipe wrench is sitting right on the top, but 
honestly, you are trying to hammer in a nail. Use the hammer! :-)

Bob S


> On Jun 29, 2017, at 24:56 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> Imagine the following scenario:
> 
> A text file containing lines of text a bit like this:
> 
> Mary Smith 12 Windsor Gardens Slough 45 housewife


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


Re: Table Fields "and all"

2017-06-29 Thread Bob Sneidar via use-livecode
The data grid was created *precicely* because of this very thing. I for one was 
constantly begging for a table object of some sort, imagining that it would 
work like an Excel Spreadsheet, but as many pointed out, there would be 
problems when the data put into a table object was too much for Livecode to 
want to deal with. 

I do not see creating a datagrid as a "knee-jerk" reaction any more than using 
a menu button is when trying to create a popup menu. If you need an object that 
can display a table of data, that can be addressed pretty simply, the DataGrid 
is what you want. 

So here is a bit of code:

set the dgData of group "dgDataGrid" to aArrayData
put the dgDataOfLine [3] into aDataRecord
put aDataRecord ["food type"] && aDataRecord ["topping1"] into tLunchEntree

It's not that difficult. Now if you want to find the record containing 
"biscuit":

dispatch findIndex to group "dgDataGrid" with ""food type", "Biscuit"
put the result into tFoundIndex
put the dgDataOfIndex [tFoundIndex] into aDataRecord

Piece of cake! Here is the DataGrid API link: 
http://lessons.livecode.com/m/datagrid/l/7344-data-grid-api

Bob S


> On Jun 29, 2017, at 24:45 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> Of course the easy answer to my post is to do a knee-jerk "datagrid" or a 
> "wait for datagrid 2" response,
> but not all of us really want the high learning and coding overhead that the 
> datagrid involves, especially when
> we might be dealing with a simple 10 x 10 table of data.
> 
> Richmond.


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


Re: synonyms

2017-06-29 Thread Mike Kerner via use-livecode
Alex,
I don't understand.  I pass arrays as parameters all the time, and I use
the pass by reference "@", too.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Array assignment / initialization [was Re: synonyms]

2017-06-29 Thread Alex Tweedly via use-livecode

On 28/06/2017 23:32, Alex Tweedly via use-livecode wrote:
Yes, it would be nice if we had an easier (terser) way to assign to an 
array. Maybe something like Python / Perl use to assign to a dictionary.


   put { "name": "my chart", "width": 100, "label": "This is a chart", 
"anarray": sAMine } into tA

   DoSomething tA

OK, here I go answering my own post (again).

function _
  local tA
  repeat with i = 1 to paramcount()
 put param(i+1) into tA[param(i)]
  end repeat
  return tA
end _

and then I can do

put _("name","my chart",   "width",100,   "label","This is a chart",   
"anarray",sAMine) into tA

DoSomething tA

or, indeed, even

DoSomething  _("name","my chart",   "width",100,   "label","This is a 
chart",   "anarray",sAMine)


Still doesn't handle pass-by-reference - but that's a problem even with 
variable numbers of params in LC, so I'll accept it for this case.


-- Alex.

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


Re: synonyms

2017-06-29 Thread Mike Kerner via use-livecode
ick.

On Wed, Jun 28, 2017 at 10:14 AM, Mike Bonner via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Even easier would be to just pass a single string like so..
>
> myhandler "type=blue,name=fred,something=234"
>
> And use split
>
> split pVar by comma and "="
>
> ending up with an array keyed by name.
>
> On Wed, Jun 28, 2017 at 5:41 AM, Paul Dupuis via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Here is some code to pass params by name - value pairs. It is relatively
> > easy with the paramCount and param functions of livecode.
> >
> > on mouseUp
> >
> >   myHandler "type=blue","name=fred","something=234"
> >
> > end mouseUp
> >
> >
> > on myHandler
> >
> >   repeat with i=1 to the paramCount
> >
> > put param(i) into tArg
> >
> > set itemDel to "="
> >
> > put item 1 of tArg into tName
> >
> > put item 2 of tArg into tValue
> >
> > put "Name:"&&&"= Value:"& after msg
> >
> >   end repeat
> >
> > end myHandler
> >
> >
> >
> >
> > On 6/28/2017 2:42 AM, FlexibleLearning.com via use-livecode wrote:
> > > This is how ChartMaker (www.flexibleLearning.com/chartmaker ) works,
> > with
> > > only the required name-value pairs and in any order. It does make
> > > implementing modifications to chart displays a lot easier for exactly
> the
> > > reasons you give!
> > >
> > > Hugh Senior
> > > FLCo
> > >
> > >> -Original Message-
> > >> I don't know when OL will be available or how it'll work.  I only know
> > >> one thing it won't support, based on an earlier conversation with Mark
> > >> Waddingham:  R-style arguments (similar in many respects to CSS
> values).
> > >>
> > >> In R, things like the plot command have reasonably-useful defaults, so
> > >> that you can just pass in data with nothing else and get a useful
> > result.
> > >>
> > >> But if you want to tailor it you pass arguments in as name-value
> pairs,
> > >> e.g.:
> > >>
> > >>plot(cars, type="o", col="blue", ylim=c(0,12))
> > >>
> > >> What I like about that is I'm free from having to remember parameter
> > >> order, which also means I don't need to add a hundred commas if I want
> > >> to pass in a value for the 101st param.
> > >>
> > >> With name-value pairs I can include only the options I want, and in
> any
> > >> order.
> > >>
> > >> Extra bonus points that the purpose of any argument is made explicit
> by
> > >> including its name.  If I see "o" I don't need to count commas and
> guess
> > >> about what that applies to, I know very clearly looking at the name
> > >> provided with it that it governs the plot type.
> > >
> > >
> > > ___
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Disallowing overscroll/bounce in the browser widget on iOS

2017-06-29 Thread Jonathan Lynch via use-livecode
Has anyone managed to block that annoying bounce effect? It looks terrible in 
an app.

I tried all sorts of CSS and JS, but no luck. I am going to explore editing the 
plist, since this is related to a UIWebView setting, but if anyone has already 
done this, it would be most helpful.

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


Re: Sharp as a pound (was Array assignment...)

2017-06-29 Thread james--- via use-livecode
Craig wrote:
> So do we in the US, though sometimes the word "hash" has been seen to creep
> about.

Now you mention it I use this too.
Seems we can internally hold multiple synonyms without even realizing that is 
what we are doing.

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


Re: Table Fields "and all"

2017-06-29 Thread hh via use-livecode
Hi all,

closely connected to that, not this much advanced as Bernd's jewel 
modTableField, another 'jewel'-stack by Scott:

http://forums.livecode.com/viewtopic.php?p=129767=fbca74cc652e7760ce1f837e482dc57a#p129767

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


Re: How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-29 Thread hh via use-livecode
> BR wrote:
> but  to be able to address the properties of the object referred
> to by a variable containing the long ID of an object/
> How do we do that?

I think the "rule" is [assume objID is the long id of an object]

get|set  of objID --- works for *properties* of the object

the number of lines is not a property, so you have to use a property
in order to get|set such things, for example

the number of lines of ...

... the text of objID  --  used in Mike's example
... field the short name of objID
... field id the short id of objId

I use the following to have a list of properties (with their current
values) I can get|set from objID:

  put the properties of objID into pp
  combine pp by cr and comma
  put pp

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


Re: Table Fields "and all"

2017-06-29 Thread Richmond Mathewson via use-livecode

One of the reasons you may not be alone is because the documentation
is not much good when it comes to table fields.

I have my suspicions that they have been overlooked; possibly in the mad 
rush towards datagrids.


Richmond.

On 6/29/17 11:13 am, Lagi Pittas via use-livecode wrote:

I had the same problem when I started using Tables and after I found the
TAB delimiter "trick" as per Hermann, it was obvious (20/20 Hind sight).
The Aha! moment came when using commas messed it up by putting them all in
1 column with the commas intact. I just assumed everybody  knew  and I was
a slow learner- nice to know I was not alone

Regards Lagi

On 29 June 2017 at 09:01, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:


Clever stuff.

Thanks an awful lot for what seemed like a knotty problem.

Also good because this:

settheitemDelimitertotab

put"Biscuits" intoitem 3 ofline 7 offld "TF"

put"Cheese" intoitem 5 ofline 7 offld "TF"

did not delete the "biscuits".

Richmond.

On 6/29/17 10:54 am, hh via use-livecode wrote:


Richmond wrote:

I want to put "cheese" into the third column across of the third line
down of my Table Field "TF"


You could try:

set the itemdelimiter to tab
put "cheese" into item 3 of line 3 of fld "TF"



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


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


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


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


Re: Table Fields "and all"

2017-06-29 Thread Lagi Pittas via use-livecode
I had the same problem when I started using Tables and after I found the
TAB delimiter "trick" as per Hermann, it was obvious (20/20 Hind sight).
The Aha! moment came when using commas messed it up by putting them all in
1 column with the commas intact. I just assumed everybody  knew  and I was
a slow learner- nice to know I was not alone

Regards Lagi

On 29 June 2017 at 09:01, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Clever stuff.
>
> Thanks an awful lot for what seemed like a knotty problem.
>
> Also good because this:
>
> settheitemDelimitertotab
>
> put"Biscuits" intoitem 3 ofline 7 offld "TF"
>
> put"Cheese" intoitem 5 ofline 7 offld "TF"
>
> did not delete the "biscuits".
>
> Richmond.
>
> On 6/29/17 10:54 am, hh via use-livecode wrote:
>
>> Richmond wrote:
>>> I want to put "cheese" into the third column across of the third line
>>> down of my Table Field "TF"
>>>
>>
>> You could try:
>>
>> set the itemdelimiter to tab
>> put "cheese" into item 3 of line 3 of fld "TF"
>>
>>
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Table Fields "and all"

2017-06-29 Thread Richmond Mathewson via use-livecode

Clever stuff.

Thanks an awful lot for what seemed like a knotty problem.

Also good because this:

settheitemDelimitertotab

put"Biscuits" intoitem 3 ofline 7 offld "TF"

put"Cheese" intoitem 5 ofline 7 offld "TF"

did not delete the "biscuits".

Richmond.

On 6/29/17 10:54 am, hh via use-livecode wrote:

Richmond wrote:
I want to put "cheese" into the third column across of the third line
down of my Table Field "TF"


You could try:

set the itemdelimiter to tab
put "cheese" into item 3 of line 3 of fld "TF"



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


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


Re: Table Fields "and all"

2017-06-29 Thread Richmond Mathewson via use-livecode

Imagine the following scenario:

A text file containing lines of text a bit like this:

Mary Smith 12 Windsor Gardens Slough 45 housewife

now getting those lines into a Table Field is going to involve messing 
around with 'quote' amongst all the "dicing and slicing".


I think I'll be a "right plonker" and give that to my programming pupils 
tomorrow afternoon.


If you never hear from me again start looking for a gravestone in 
Bulgaria with a Table Field on it!


Richmond.

On 6/29/17 10:45 am, Richmond Mathewson wrote:
I want to put "cheese" into the third column across of the third line 
down of my Table Field "TF"


put "cheese" into column 3 of line 3 of fld "TF"   did not work,

put "cheese" into item 3 of line 3 of fld "TF"

put "cheese" into the first column preceded by two commas (default 
itemDelimiters).


put tab & tab &"cheese" into line 3 of fld "TF"

"worked" insofar as it put "cheese" into column 3, but it also deleted 
other data in columns 1 and 2 . . .


That use of 'tab' seems clunky in the extreme . . .

And, things are "not much good" if on entering data it deletes other 
data elsewhere.


I found something very helpful for getting an Array into a Table Field

[ 
http://lessons.livecode.com/m/4071/l/7810-how-do-i-display-an-array-in-a-table-field 
]


but that didn't really help me.

put "Biscuits" & "cheese" into line 3 of fld "TF"   gave me 
"Biscuitscheese" in the first column


'obviously'

put "Biscuits" & tab & "cheese" into line 3 of fld "TF"

did separate the biscuits from the cheese.

This is "a right pox" as, presumably, if one imports a comma delimited 
data file from outside Livecode one has to
go through a "pretty glorious" rigmarole getting all the stuff into 
the right slots.


---

Of course the easy answer to my post is to do a knee-jerk "datagrid" 
or a "wait for datagrid 2" response,
but not all of us really want the high learning and coding overhead 
that the datagrid involves, especially when

we might be dealing with a simple 10 x 10 table of data.

Richmond.


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


Re: Table Fields "and all"

2017-06-29 Thread hh via use-livecode
> Richmond wrote:
> I want to put "cheese" into the third column across of the third line 
> down of my Table Field "TF"


You could try:

set the itemdelimiter to tab
put "cheese" into item 3 of line 3 of fld "TF"



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


Table Fields "and all"

2017-06-29 Thread Richmond Mathewson via use-livecode
I want to put "cheese" into the third column across of the third line 
down of my Table Field "TF"


put "cheese" into column 3 of line 3 of fld "TF"   did not work,

put "cheese" into item 3 of line 3 of fld "TF"

put "cheese" into the first column preceded by two commas (default 
itemDelimiters).


put tab & tab &"cheese" into line 3 of fld "TF"

"worked" insofar as it put "cheese" into column 3, but it also deleted 
other data in columns 1 and 2 . . .


That use of 'tab' seems clunky in the extreme . . .

And, things are "not much good" if on entering data it deletes other 
data elsewhere.


I found something very helpful for getting an Array into a Table Field

[ 
http://lessons.livecode.com/m/4071/l/7810-how-do-i-display-an-array-in-a-table-field 
]


but that didn't really help me.

put "Biscuits" & "cheese" into line 3 of fld "TF"   gave me 
"Biscuitscheese" in the first column


'obviously'

put "Biscuits" & tab & "cheese" into line 3 of fld "TF"

did separate the biscuits from the cheese.

This is "a right pox" as, presumably, if one imports a comma delimited 
data file from outside Livecode one has to
go through a "pretty glorious" rigmarole getting all the stuff into the 
right slots.


---

Of course the easy answer to my post is to do a knee-jerk "datagrid" or 
a "wait for datagrid 2" response,
but not all of us really want the high learning and coding overhead that 
the datagrid involves, especially when

we might be dealing with a simple 10 x 10 table of data.

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


Re: How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-29 Thread hh via use-livecode
> BR wrote:
> but  to be able to address the properties of the object referred to by a 
> variable containing the long ID of an object/
> How do we do that?

  put the long id of fld 1 into fID
  put the short name of fID into sID
  put the number of lines of fld sID
 

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