Re: Standardize Font Appearance

2022-09-13 Thread Quentin Long via use-livecode
sez Richard Gaskin:
> So help me understand: what are you working on where a user expects > 
> fine-grained font rendering consistency on multiple OSes? What do these > 
> apps do?> > Do your users switch OSes during a session, or work on Windows by 
> day > and Mac at night?  How many also use Linux in that multi-OS workflow?
For me, it was mostly a matter of two questions.
First: Wouldn't it be nice *if* we could somehow do stuff with fonts and just 
have them *be* identical cross-platform? My answer: Yes, that *is* technically 
possible—
Second: Exactly how big of a hassle *would* it be to Just Have Fonts Identical 
Cross-Platform? My answer: —but good god, it's *so* much of a fucking PITA that 
I can't imagine why anyone would *bother*.
I'm rather an odd duck, in that I don't write code for a living; I don't even 
have any financial interests which are dependent on my being able to whip up 
code on schedule/deadline. So I suspect I may have summat more freedom to fart 
around and experiment than do the *real* code jockeys hereabouts. As well, the 
only user *I* have to worry about is *me*, which renders lots of issues, er, 
*non*-issues, as far as I'm concerned.


"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"Read the webcomic 
at [ http://www.atarmslength.net ]!If you like "At Arm's Length", support it at 
[ http://www.patreon.com/DarkwingDude ].
___
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


Cross-platform font handling, and why you don't want to do it

2022-09-05 Thread Quentin Long via use-livecode
Cross-platform font compatibility is a hellacious rat's nest of mismatches. It 
may or may not be worse than handling time (Daylight Savings Time? leap years? 
leap *seconds*? etc, ad nauseum), but it's plenty bad enough on its own merits, 
or lack thereof.
* You can't be 100% confident that your user will have the same font(s) you do 
installed on their system.
* If your user has a font *of the same name* as your font installed on their 
system, you can't be 100% confident that *their* font came from the same font 
foundry as *your* font. Yes, font names are legally protected, but... 
Helvetica, anyone?
* If your user has a font *of the same name* as your font installed on their 
system, you can't be 100% confident that it's the *same* font you have. Again: 
Font names are legally protected. But what if you have version 15.0 of 
RandomFontFoundry's WhateverFont on your system, but your user only has version 
1.0 of RandomFontFoundry's WhateverFont? Who *knows* what tweaks 
RandomFontFoundry may have made to WhateverFont in between those two version 
numbers?
* Can you be 100% confident that version 15.0 of RandomFontFoundry's 
WhateverFont *for Mac* is going to render *exactly the same* as version 15.0 of 
RandomFontFoundry's WhateverFont *for Windows* or *for Linux*? No. You cannot. 
Different type rendering engines on different OSes *ensure* that rendering 
compatibility will be problematic at best.
* Assuming your user has exactly the same version of exactly the same font on 
exactly the same OS you do, you can't be 100% confident that your user has 
installed the font metrics data (kerning, sidebearings, etc)—which means you 
have no idea if the damn thing will look the same on your user's system as on 
your system.
If you want to *ensure* that some piece of text looks *exactly the same* 
cross-platform, the only way to get there is to format the text the way you 
want it on one platform, take a screenshot, and use that graphic. But even 
then, can you be 100% confident that your user *hasn't* tweaked some setting on 
their system which messes with graphics..?

The "take a screenshot" solution is not well-suited for any use-case involving 
text which varies from time to time, and largely impractical for any use-case 
involving text which is input by the user. In principle, it should be possible 
to create a library of glyph-images of all glyphs in a font, and import those 
glyph-images as necessary—no, mass quantities of "set the imageSource of char X 
to $GlyphImage" commands ain't gonna fly, cuz letterspacing will look 
crappy—but that "solution" is tantamount to building your own, redundant, set 
of text-handling routines. Yuck!
If "take a screenshot" doesn't work for you, I suspect the next-best route to 
achieving Absolute Cross-Platform Font Fidelity may be this:
 1) Open up your font in your font-editing utility of choice (Fontographer, 
Glyphs, FontLab, whatever)
2) Export your font N times, once for each of the *other* OSes you need font 
compatibility with—WhateverFontMac, WhateverFontWindows, WhateverFontLinux, etc
3) Open up your stack within each of the OSes you're working with, always using 
the appropriate OS-specific version of your font, and see how different your 
stack looks on the other OSes
4) Tweak the font metrics on the other-OS versions of your font until your 
stack looks the same on all OSes
5) When it's time to distribute your stack, be sure to bundle *all* the 
hand-tuned OS-versions of your font with your stack
This procedure is, of course, a royal pain in the arse. Hellacious rat's nest 
of mismatches, yada yada yada. But regardless of how painful it is? If you need 
absolute visual fidelity cross-platform, *and* total flexibility in the 
*content* of text, this procedure may be your least-bad option.
As a perhaps-preferable option:
1) Open up your stack on each of the OSes you're striving for font 
compatibility on
2) Tweak the appearance-relevant text properties (textFont, textHeight, 
textShift, etc) on each OS until you get an acceptable approximation of 
identical appearance
3) Make note of the values of all these text properties for each OS
4) Assuming you have however-many fonts specified by fontName, be sure you 
bundle all those fonts with your stack when you distribute it
5) Include in your stack's preOpenStack handler a switch which includes "case = 
WhateverOS" for each OS you want font compatibility for
6) Within each OS's "case", set all the appearance-relevant text properties for 
that OS
This procedure is not going to achieve anywhere near the degree of 
cross-platform font fidelity as the "roll your own" solution above. On the plus 
side, it's *significantly* less nitpicky/picayune/painful. You puts in your 
money, and you takes your chances...

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ]. 

Funky dice (was Re: Generating Random numbers to conform a distribution)

2022-06-08 Thread Quentin Long via use-livecode
From: Richard Gaskin 
> When I was making a game for a friend last summer I fell in love with 
> the Royal Game of Ur (RGoU)…> The dice used in RGoU are binary in range, 
>tetrahedra with the faces 
> blank and two of the four points painted.
> …> If you ever need to plot dice probabilities, this tool handles nearly 
> any number of any type of dice you can think of (except Ur dice, it 
> turns out, but oh well):
>> https://anydice.com/

Ur dice are functionally synonymous with coin-flips—basically, D2s with 
nonstandard markings. Rather than a 2-sided die marked "1" and "2", an Ur die 
is effectively a 2-sided die marked "0" and "1". So if you want to implement Ur 
dice in LiveCode, you have a couple of options:
any char of "01"
(the random of 2) - 1
Or, if you want to play with Ur dice in anydice.com:
output 1d2 - 1output 4d2 - 4
There are various nonstandard uses of dice in the roleplaying game hobby.
Example: The FATE rolegame uses six-sided dice, but they aren't marked with the 
first six integers. Instead, two faces are marked with minus signs; two faces 
are blank; and the final two faces, with plus signs. When you roll FATE dice, 
any die that comes up with a minus sign is counted as negative one, any die 
that came up blank is counted as zero; and any die that came up with a plus 
sign is counted as positive one. The standard FATE die-roll uses four FATE 
dice, hence has a range of -4 (if all four dice came up minus) to +4 (if all 
four dice came up plus). To implement FATE dice in LiveCode, this will do the 
trick:
(the random of 3) - 2
Or the anydice.com equivalent:
output 1d3 - 2output 4d3 - 8
Example: The Shadowrun rolegame (basically a mashup between cyberpunk and high 
fantasy) uses normal six-sided dice, but rather than adding up all the dice, 
you instead count the quantity of dice which came up either 5 or 6. That is, 
you have a 1/3 chance of getting a 1, and a 2/3 chance of getting 0. To 
implement Shadowrun dice in LiveCode, the following one-liner will do:
any char of "001"
I *think* anydice.com *ought to* be able to handle Shadowrun dice, but at 
present, I don't know what sort of syntax is required to make that happen.

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
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: Speed up a slow loop

2022-03-08 Thread Quentin Long via use-livecode
It occurs to me that any word which is valid in Boggle must consist of an 
uninterrupted run of letters which are *right next to each other* on the board. 
Hence, any digraph which *doesn't* consist of a pair of neighboring letters, 
*cannot* occur in any valid word.
Since the "filter out all words with LettersNotOnTheBoard" idea worked, it may 
be that an analogous "filter out" operation can speed things up more. When 
setting up a new board...
-- Construct a list of all 576 ( = 26x26 ) digraphs—"aa,ab,ac, … zx,zy,zz". Or, 
more likely, construct that list ahead of time, and store the list in a stack 
property.-- Remove all digraphs which contain at least one letter that's not on 
the board.-- Make a list of all pairs of neighboring letters on the board. 
Since you don't know which direction an arbitrary digraph is running in, you'll 
want to include ZA as well as AZ.-- Remove all the digraphs present on the 
board from the ListOfAllDigraphs.-- Replace all the "," in the 
ListOfAllDigraphs with "|". (i.e., replace commas with pipes)
-- Put "[" & ListOfAllAbsentDigraphs & "]" into RegexPattern.-- Filter WordList 
without RegexPattern.-- ???-- Profit.
Hmmm... since this starts out with a complete list of all 576 digraphs, there's 
no need to do a separate regex filter on individual letters; filtering out the 
full list of unused digraphs should encompass filtering out unused letters. 
Hence, just one regex filter should do the job. I think.
On a 4x4 Boggle board, there are 72 neighboring pairs, hence a maximum of 144 
valid digraphs; on a 5x5 board, there are 110 neighing pairs, hence a max of 
220 digraphs. Hopefully, this won't add too much overhead to board setup.

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
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: Speed up a slow loop

2022-03-08 Thread Quentin Long via use-livecode
sez Alex Tweedly:> The caveat - a user guess which isn't in the word list found 
by the > boardwalk can be either "not a word" or "a word, but not present on 
the 
> board", and you don't know which.
Does it *matter* whether a genuine word isn't on the board? If the board has no 
"L" in it, any word with an "L" won't be on the board, right?

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
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: use-livecode Digest, Vol 222, Issue 8

2022-03-07 Thread Quentin Long via use-livecode
sez j. landman gay:
> Interesting idea. There are 25 letters on each board, some are always 
> repeats. I think I'd need 
> a good regex so I wouldn't have to run the filter command multiple times. 
> How's your regex?

I see you've already implemented something, but just for grins, here's my 
thought re: the One True Regex for this situation:
AbsentChars is the name of a variable which contains all the letters that 
*aren't* on the board. My first attempt at the regex is…
filter lines of WordList without "*[AbsentChars]*"
However, that will remove all words that contain at least one letter in the 
specific character string "absentchars", which is not what I want. So, bring 
out the "do" keyword…
do ("filter lines of WordList without" && quote & "*" & AbsentChars & "*" & 
quote)

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
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: Speed up a slow loop

2022-03-05 Thread Quentin Long via use-livecode

So… a Boggle game. Hm. Seems to me that anything you can do to reduce the 
number of words you need consider at any given time would be a win. Maybe not a 
*big* win, but still a win. So perhaps give this idea a shot:

When you create a new board:

-- Make a list of all the letters which *are not* on the board


-- Filter out any word that contains at least one letter on the "not on this 
board" list

-- Use the thus-reduced wordlist for all purposes as long as the board doesn't 
change

This would add a bit of overhead to the process of setting up a new board, but 
if it results in time savings during play, the extra overhead might be 
worthwhile anyway.



"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
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: Sorting cards

2021-12-30 Thread Quentin Long via use-livecode
sez J. Landman Gay:> I am converting an old stack to LC and it needs to sort 
cards by one of two fields. LC does 
> stable sorts, so if I sort by field 1 it works, and then if I sort later by 
>field 2 it retains 
> the original sort and does a sub-sort. I don't want that. What's the best way 
>to ignore the 
> previous sort order?

Hmmm… how about this?
1. Give each card a custom property, call it "SortValue" or some such.2. 
*Before* the first sort: Go thru each card and set the SortValue of each card 
to an integer, incrementing the number by 1 with each new card.3. *After* the 
first sort: Do a new sort, by the SortValue of each card. This should get the 
former order of the cards back.
If you do this, you can obviously re-assign the card-values of SortValue at any 
time, hence you can restore any arbitrary card-order you want with a fresh 
"sort by SortValue of each card".

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
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


For the record…

2021-10-28 Thread Quentin Long via use-livecode
In case anybody actually was curious to know how to type an infinity symbol: On 
a Mac, the keystroke is option-5.
Also on the Mac, there's a cute thingie called "Keyboard Viewer" which does 
what it says on the label. KV displays your entire keyboard, *and* it shows you 
the complete set of characters you can get when you hold down the option key, 
as well as shift-option. It also nicely accommodate the "dead keys" which let 
you type characters with accent marks.
If you've set your machine up to display the "keyboard" dealie in the menubar, 
you can access KV from there. If you haven't done that, you can do it by 
bringing up System Preferences > Keyboard, and clicking on "show keyboard and 
emoji viewers in menu bar"… well, that's how it is in MacOS 10.13.6; I make no 
guarantees re: how Apple may have rearranged things in other OS versions.
And if you neither have the "keyboard" dealie in your menubar, nor *want* to 
have that, bring up SysPref > Keyboard and click on the "Input sources" tab. 
This option isn't *quite* as nice as the genuine KV—it doesn't really handle 
"dead keys"—but it can serve. Again, caveat re: Apple mucking with OS versions, 
yada yada yada.


"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ]. 
___
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: Changing text properties in a field via the IDE

2020-05-19 Thread Quentin Long via use-livecode
Just saw an improvement in my code that *should* make it happy to work with 
Unicode characters…

local OkayChars = ""
function CleanASCII3 DerText  if OkayChars = "" then -- construct OkayChars 
string as needed    repeat with K1 = 32 to 126      put numToChar (K1) after 
OkayChars    end repeat  end if
  put "" into DerRezult  repeat for each char CC in DerText    if CC is in 
OkayChars then put CC after DerRezult  end repeat  return DerRezultend 
CleanASCII3
Again, this code has not been tested, so use with caution.
___
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: Changing text properties in a field via the IDE

2020-05-19 Thread Quentin Long via use-livecode
While Bob Sneidar's function should do the job of scrubbing weird characters 
from text, am unsure why he felt the need to construct that massive pCustomList 
variable. Seems to me that it would be simpler, and perhaps quicker, to do this 
instead:
function cleanASCII2 DerASCII  put "" into DerRezult
  repeat for each char CC in DerASCII    put charToNum (CC) into Fred    if 
Fred > 31 and Fred < 127 then put CC after DerRezult -- the full range of ASCII 
values for printable characters  end repeat  return DerRezultend cleanASCII2
The above code is not tested in any way. It's clearly not to be trusted with 
Unicode text, so which might be why Sheidar felt the need to go thru a somewhat 
more complicated procedure…
___
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: What is a real?

2020-04-25 Thread Quentin Long via use-livecode

sez Bob Sneidar :>Apparently nothing is a real. 
Neither is anything strictly a real. 
 [singing] "Let me take you down, 'coz I'm going to Strawberry Fields…"
___
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: Building a Board Game

2020-04-10 Thread Quentin Long via use-livecode
On 7.04.20 22:24, Roger Guay via use-livecode wrote:
> Hi all,
>
> I know there must be a simple way to do this but it is escaping me at the 
> moment. How can I move an object (grab me on mouseDown) and have it snap to a 
> grid (square on a board game) on mouseUp?
There are any number of ways to do this thing. Try giving this script to the 
object you want to move:
local DisX, DisYlocal GridSize = 20-- if grid uses different sizes for X and Y, 
make GridSizeX and GridSizeYlocal OriginGridX = 10local OriginGridY = 10
on mouseDown  send "TrackDaMouse" to meend mouseDown
on TrackDaMouse  put the mouseLoc into Fred  put GridSize * ((item 1 of Fred - 
OriginGridX) div GridSize) + OriginGridX into DisX  put GridSize * ((item 2 of 
Fred - OriginGridY) div GridSize) + OriginGridY into DisY  set the loc of me to 
Fred  if the mouse is down then    send "TrackDaMouse" to me in 20 msec  else   
 move me to (DisX, DisY) in .5 seconds  end ifend TrackDaMouse
___
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


Possible new dev hardware?

2020-04-01 Thread Quentin Long via use-livecode
Atari is apparently producing a gizmo they call the "Atari VCS", which they're 
positioning primarily as a video game console. However! According to an email I 
just got from them, this beast has what they're calling "Atari sandbox mode 
(install any OS)", and they claim "If you want to develop just for fun or for 
other platforms, use Sandbox Mode to install any development environment you 
want." The relevance to LiveCode is left as an exercise for the reader.
The URL to the propaganda website:

https://atarivcs.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: Guessing the encoding of a test file...

2020-03-21 Thread Quentin Long via use-livecode
I strongly suspect that the desired goal, to have a nice, robust algorithm 
which automagically identifies the encoding of *ABSOLUTELY ANY* text document 
with zero need for human involvement, simply isn't possible. Because text 
encoding is intrinsically arbitrary—see also: the many variations on extended 
(8-bit) ASCII, the various mutually-incompatible versions of EBCDIC, etc ad 
nauseam.
Seems to me, therefore, that in the general case, human involvement is an 
*unavoidable necessity* in determining which encoding an arbitrary text 
document uses. So the goal of any encoding-ID algorithm should *not* be the 
impossible task of determining that encoding *without* human involvement. 
Rather, the goal should be to *minimize* that human involvement, make that 
human involvement as *simple and painless* as practically feasible. So, here 
goes with some semi-random rambling…  Pretty sure the best, most nearly 
bulletproof way to ID a document's text-encoding involves applying that 
encoding to the bits of the document, and showing the resulting 
character-sequence to a human. If there's more than one possibility for the 
document's encoding, apply all of the possible encodings, and show a human all 
of the resulting character-sequences. I'm thinking that a good way to do this 
might be to put up N different text fields in a window, with all of the text 
fields controlled by one scrollbar, and the human clicks on all of the fields 
whose content looks good to them. Or maybe the human clicks on all the fields 
whose output looks *bad* to them? Whichever way works; as long as there *is* 
some human judgement in there somewhere.
Can we assume that once a particular document's text-encoding has been 
identified, that *all* documents which came from the same source as that 
document use that particular encoding? If so, that might simplify the 
continuing workflow; tell the software "This document came from Source X", and 
the software then uses whichever text-encoding it associates with that source. 
Even if there's more than one such text-encoding in play, that's at least 
easier to work with than having to sort thru an arbitrarily large number of 
text-encodings.
Is it possible to tell the software "hey, no character in $ThisSetOfChars will 
ever appear in this document"? If so, the software should be able to rule out 
any encoding which ends up putting one of the Forbidden Chars into the decoded 
character-sequence.

Given human error, it may be that the human's input ends up ruling out *any 
possible* text-encoding. Prolly a good idea to use something akin to fuzzy 
logic rather than strict Boolean operations.

___
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: Identifying Un-used functions and commands

2019-11-28 Thread Quentin Long via use-livecode
> Date: Tue, 12 Nov 2019 12:12:47 -0500
> From: Stephen MacLean 
> To: How to use LiveCode 
> Subject: Identifying Un-used functions and commands
> Message-ID: 
> Content-Type: text/plain; charset=utf-8
> 
> Hi All,
> 
> I?m wondering if anyone has a way or code to identify any un-used functions 
>and commands in a set of stacks?

Finding explicit function/command calls seems like it should be a fairly 
straightforward task. However, the "do" keyword can also be a source of 
function/command calls, which complicates matters a wee bit. You'll also need 
to evaluate all the non-cleartext components that can go into "do" statements—
do (VariableName)
do (the WhateverProp of ThisObject)
do (line 4 of fld "ThisField")
—etc etc etc.
___
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: math on widths doesn't add up (Sean Cole (Pi))

2019-07-10 Thread Quentin Long via use-livecode
sez Sean Cole (Pi):>I've just been teaching my youngest about the 4th - nth 
dimensions. Time is
>not the 4th but the 1st temporal dimension. If the 3 spatial dimensions are
>Length, height and width then the 4th is depth, ie, going inwards and
>outwards as the easiest way to picture it (but not truly representative).
>That being the case, how would you describe the 5th spacial dimension.
>That'll twist your noggin if it's not something you've thought of before :)
One fictional contemplation of the 4th and 5th 
dimensions:https://johnesimpson.com/pdf/Ifth_of_oofth-waltertevis.pdf
___
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


After the conference

2019-05-17 Thread Quentin Long via use-livecode
Quentin Long here. As luck would have it, I'm going to be singing in a concert 
on the Friday after the LiveCode Conference. I have no idea how many LCC 
attendees will still be in the Bay Area on Friday, but for the benefit of those 
who are:
The program: Ein deutsches Requiem, by Brahms
The time: 8 PM on Friday, 24 MayThe ticket price: FreeThe location: Stanford 
Memorial Church, in the campus of Stanford UniversityThe googlemap: 
https://goo.gl/maps/hpmagnkmUVfcEgTX6
___
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: Seeking philosophical guidance on library interface design

2019-04-25 Thread Quentin Long via use-livecode
Hmmm… Seems like this library is intended for a summat limited subset of 
graph-styles. There are pie charts, radar charts, etc ad nauseum, and it's not 
clear to me how this library caan cope with any of those "non-standard" types 
of graph. As well, it's unclear to me how this library will deal with funky 
axis-styles (logarithmic?).

Am *not* suggesting that the library must, or even should, be able to handle 
*every* graph-style that might conceivably be thrown at it—that way lies 
madness. Just thinking that it might be good to include, in the documentation, 
a prominent, clear statement of What This Library Can And Cannot Do, to manage 
user expectations.


"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"


Read the webcomic at [ http://www.atarmslength.net ]!


If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: Musings on Architect, MVC, Nested Behaviors

2018-12-28 Thread Quentin Long via use-livecode
> From: Richard Gaskin 
>> J. Landman Gay wrote:
>>
>> On December 27, 2018 2:36:16 PM Richard Gaskin via use-livecode
>>  wrote:
>>>
>>> Sounds like one more reason to allow stack properties as YAML
>>> frontmatter in the file. Ever since I suggested that a couple
>>> years back, the range of valuable use-cases keeps growing.
>>
>> I wouldn't mind if you poked them again about it.
>
> At your prompting I started to open an enhancement request for this, but
> not long into it I hit on why they probably haven't done this yet:
>
> By what means would be indicate which properties we want saved there and
> which ones we don't care about?

To a first approximation, I'd say that any property which has been changed from 
the engine's built-in default value should be saved. One would expect that the 
engine's defaults can be easily accessed for such a purpose?


"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"
Read the webcomic at [ http://www.atarmslength.net ]!
If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].
___
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: Searching for a word when it's more than one word

2018-09-02 Thread Quentin Long via use-livecode
Have pondered the question, and come up with some code which may or may not 
solve the problem at hand, but which may at least prove helpful in looking for 
a real solution:

==

Assumption: You’ve got a text document (not HTML, not RTF, just plain TXT) 
which contains, among other things, however-many place names.
Assumption: You have a return-list of place names, which may or may not be 
single words
Assumption: The text document is in the variable SourceDoc
Assumption: The list of place names is in the variable NamesList

Assumption: You want a document which contains a complete census of exactly 
which of the place-names in NamesList occur in SourceDoc
Assumption: For each place-name which does occur within SourceDoc, you want a 
list of which word-numbers each such occurrance begins at

put “” into PlaceNamesCensus
repeat for each line DisName in NamesList
  put the number of words in DisName into DisNameWords
  put 0 into SearchOffset
  put “” into FoundLocs
  repeat
    put offset (DisName, SourceDoc, SearchOffset) into DisLoc
    if DisLoc = 0 then
  -- there is no character string which matches the place name in question
  end repeat
    else
  —- there is a character string which matches the place name in question
  —- is it the actual placename, and not finding “chester” in “colchester”?
  put the number of words in (char 1 to DisLoc of SourceDoc) into StartWord
  if DisName = (word StartWord to (StartWord + DisNameWords - 1) of 
SourceDoc) then
    -- it’s a match, yay!
    put StartWord into item (1 + the number of items in FoundLocs) of 
FoundLocs
  end if
  add DisLoc to SearchOffset
    end if   
  end repeat
  if FoundLocs <> “” then
    —- nope, DisName wasn’t in SourceDoc
    put “[nil]” into DeseLocs
  else
    —- yay! DisName *was* in SourceDoc! at least once!
    put FoundLocs into DeseLocs
  end if
  put DisName & comma & DeseLocs into line (1 + the number of lines in 
PlaceNamesCensus) of PlaceNamesCensus
end repeat

==

Known issue: The above code does not pretend to locate possessive instances of 
place names (i.e., California's, the United Kingdom's, etc). Am thinking that 
pre-processing of SourceDoc will be helpful-to-necessary. This pre-processing 
may need to accommodate more issues than just possessives.
 

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"
Read the webcomic at [ http://www.atarmslength.net ]!
If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].
___
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: valueDiff for arrays

2018-08-07 Thread Quentin Long via use-livecode
Suggestion for the language-token for this function: "transplant".

transplant [qualification] from [SourceArray] to [TargetArray]

[qualification] is a pattern/expression which describes exactly which bits you 
want to move from SourceArray to TargetArray.

If TargetArray doesn't exist, it should be created to hold the stuff from 
SourceArray.

It occurs to me that "transplant" might also be useful as a string-manipulation 
function:

transplant [ChunkType]s where [qualification] from [SourceContainer] to 
[TargetContainer]

Am thinking that the default behavior should be to have the transplanted bits 
be added to the *end* of TargetContainer. Again, if TargetContainer doesn't 
exist, it should be created. It might be useful to be able to specify exactly 
where the transplanted bits get inserted, so maybe:

transplant [ChunkType]s where [qualification] from [SourceContainer] to 
[Location] of [TargetContainer]

"Location" could be "start", or "end", at minimum, or possibly an expression 
that evaluates to a location within TargetContainer.

Am unsure how much of a hassle it would be to implement this, so I shall leave 
it in the capable hands of Mr. Waddingham & Co.



"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"
Read the webcomic at [ http://www.atarmslength.net ]!
If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].
___
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

About the 2019 LiveCode Conference

2018-05-18 Thread Quentin Long via use-livecode
Have just started a googlemap with markers for various points of interest in 
the general vicinity of the Conference. Right now it's just a bunch of 
restaurants, some of which also serve alcohol. Will add more markers as time 
permits.

https://drive.google.com/open?id=10NeWvnKoVmOnoXFP_68Jzjuvr-s3QE_T=sharing

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].
  


___
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: A modest proposal for a new property

2017-09-29 Thread Quentin Long via use-livecode
sez hh :
> > > JLG wrote:
> > > The original issue that influenced this one was how to provide a
> > > larger hit zone on an SVG widget.
> > > How would this property work for that?
> 
> > Quentin L. wrote:
> > I?m thinking that a single line of code would suffice:
> >
> > set the clickableRegion of widget ?Fred? to ListOfPoints
> >
> > As i?ve noted previously, the engine *already* handles clickable
> > regions for *every* control ... 
> 
> No. Sadly (or luckily, depending on one's point of view) a widget is
> not an ordinary control. This has to be implemented in the widget.
Hold it. I don't--can't--believe that the engine *does not* take care of 
deciding when a given mouse-click does or doesn't land on a widget. Unless 
you're saying that the mouse-click might trigger *either* the widget itself, 
*or* the widget's script, depending on exactly what location the mouse-click is 
at?

> To see this write one that handles only the mouse events, not to
> speak of a clickable region.
> Even this is hard to control: who gets first which mouseEvent, the
> widget's script or the widget.
I don't see what difference it makes whether a mouse-click causes mouse events 
to be sent to the *widget proper*, or, instead, to the *widget's script*. 
Either way, *something* has to determine whether the dingus is triggered by a 
mouse-click at an arbitrary screen location, right? And if it's not the engine 
which does that… what *is* doing that?

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: use-livecode Digest, Vol 168, Issue 50

2017-09-27 Thread Quentin Long via use-livecode
sez “J. Landman Gay" :
> The original issue that influenced this one was how to provide a larger hit 
> zone on an SVG widget. How would this property work for that?
I’m thinking that a single line of code would suffice:

set the clickableRegion of widget “Fred” to ListOfPoints

As i’ve noted previously, the engine *already* handles clickable regions for 
*every* control, and my proposal ‘merely’ (he says, optimistically…) opens up 
the engine’s mechanisms to the extent of granting developers the opportunity to 
override the engine’s default “define the clickable region” behavior. If a dev 
is happy with the default clickable regions provided by the engine, that dev 
can just ignore the clickableRegion property and everything should work the 
same as it always did… but if a dev *isn’t* happy with the default clickable 
regions provided by the engine, *then* that dev can mess around with the 
clickableRegion property.



   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: A modest proposal for a new property

2017-09-27 Thread Quentin Long via use-livecode
sez  hh :
To: use-livecode@lists.runrev.com
> How would you determine that a clickLoc is within such a
> "region" or not?
> (Say, for simplicity, the region is inside the control's
> rectangle)
Given that the engine *already does* have *some* sort of mechanism for 
determining which control gets triggered by a click at an arbitrary location, 
I'm pretty sure that this is a solved problem on some level. As matters stand, 
the clickable region for a control is entirely determined by the engine; my 
proposal makes that clickable region a thing which developers can adjust.

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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

A modest proposal for a new property

2017-09-26 Thread Quentin Long via use-livecode
In the past few List digests, there's been some discussion of practical issues 
regarding when a click does or doesn't count as clicking *on* a particular 
item. So, here's a proposed addition to LiveCode…

=

Name: clickableRegion

Recognized abbreviation: clickReg

"clickableRegion" is a proposed property of anything in a stack that might a 
user might reasonably be expected to click on—controls, that is. We're talking 
buttons, fields, graphics, images, yada yada yada.

The clickableRegion of a control is a return-delimited list of points that 
define a region of the screen. Since clickableRegion is a property of a 
control, the engine's internal representation of these points should probably 
use the location of the control as the origin (the 0,0 point) for the 
clickableRegion's points.

Any click whose clickLoc is within the area defined by a control's 
clickableRegion, will be treated by the engine as if it were a click on that 
control.

The default value of a control's clickableRegion should be determined by that 
control's visible-on-screen pixels—for fields, this should be the field's 
rectangle; for graphics, this should be the points of the graphic; and so on 
and so forth.

The clickableRegion property should be both get-able and set-able. If you clear 
the clickableRegion (such as by setting it to ""), it should revert back to its 
default value.

Since clickableRegion can be set to arbitrary values, it may well happen that 2 
or more controls have overlapping clickableRegions. This may not be a problem 
if the engine can simply make use of whatever magic it does when it handles 
clickLocs which fall within the rects of 2+ overlapping buttons. If the 
engine's existing 'click-disambiguation' machinery does not suffice to 
determine which control an ambiguous click is meant for, go with the control 
that has the highest-value layer property.

=

Thoughts/comments/complaints?


   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: Points of Graphic Oval

2017-07-31 Thread Quentin Long via use-livecode
The obvious method for generating the points of an oval—use a loop that 
generates sin(x) & cos(x) coördinate-pairs—has already been mentioned. What's 
*not* so obvious, is that the points generated by that method are not evenly 
spaced! Not unless you're working with a perfect circle, anyway. For non-circle 
ovals, the distance between any two consecutive points will rise with the 
distance between those points and the origin. So if you're using those points 
in a "move [whatever] to the points of"-type command, the thing you're moving 
will not move at a constant speed… well, not unless your 'oval' is a circle, in 
which case the distance to the origin will be constant, hence the resulting 
speed of motion will also be constant.

The closer your 'oval' is to a perfect circle, the less obvious the deviations 
from constant speed will be, of course. You'll have to decide for yourself 
whether those deviations are of great-enough magnitude to be worth worrying 
about.

If deviations from constant speed *are* worth worrying about? Depending on what 
you're actually doing, you may actually want to have the oval-path-constrained 
motion vary in speed, and the particular mode of variance you end up with may 
be exactly the mode of variance you get from using the obvious method. But in 
any other case, you may want to look into a different method for generating the 
set of oval-points you use.

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: "clipsToRect" property

2017-06-14 Thread Quentin Long via use-livecode
My 2 cents' worth: Rather than "clipsToRect", call the property "visibleRect". 
Because that's what it is—it's the rectangular area of the screen, within which 
the specified portion of the group is visible.

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: breakpoint on parameter

2017-05-24 Thread Quentin Long via use-livecode
sez "J. Landman Gay" :
| On 5/23/17 10:36 AM, Matt Maier via use-livecode wrote:
| > I want to find out which parts of my code are making changes to a control's
| > parameter. Specifically, I've got an arrow that I want to be black, and it
| > is black when it's created, but then it turns gray. I can't find the script
| > that's turning it gray.
| > 
| > I don't know where to put a breakpoint in the script.
| > 
| > Can I put a breakpoint on that control's color parameter, so execution
| > stops whenever something modifies it and goes to the script that's doing
| > the modification?
| 
| You can't break for a parameter per se, only at a specified line of 
| script. …
I just had an idea that might be helpful for Matt Maier…

If I'm reading the LC Dictionary aright, the property "executionContexts" 
should be very useful for nailing down which handler did what at whatever time; 
you just need to look at the executionContexts at just the right moment. So, 
use a "send [whatever] in [time]" loop, like so:

on ColorCheck
  if (the color of the specific control) = "gray" then
answer the executionContexts
  end if
  if the optionKey is up then send "ColorCheck" to me in 50 milliseconds
end ColorCheck

Ordinarily, "send [whatever] in [time]" loops are frowned upon because they 
burn cycles gratuitously, thus slowing down the stack's operations. But in this 
case, slowing down the stack's operations should be acceptable, as it gives you 
a better chance of catching the offending command (i.e., the one that's doing 
the color-change) in the act.

Troubleshooting: If what's really happening is an change in the control's blend 
property, that could make the control *appear* to change color while said color 
is actually the same, in which case the "answer the executionContexts" line 
would never execute. If this happens, check for a change in the control's blend 
property, not a change in the control's color property.
   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: looking for a smart approach to "sort" an array

2017-05-06 Thread Quentin Long via use-livecode
sez "Tiemo Hollmann TB" :
To: "LiveCode User Liste senden" 
> I have a list field of words and a correspondent array with the words of the
> field as the keys plus some data per key. I can store the array in a file,
> read it later from file and rebuild the list of words from the keys of the
> array. Up to now, I had this list of words alphabetically sorted. So it was
> easy, when reloading the array to sort the list always alphabetically to
> refresh the visible list in the field.
> 
> The user can also create a custom sequence of the words in the field by drag
> and drop the lines in individual order. Now I am looking for a smart
> approach to keep the same sort order in the correspondent array. I need the
> custom sort order of the words in case I reload the array later from file to
> get the same sequence of words as the user has sorted them, after extracting
> the words from the array. The key of the array has to keep the words from
> the list for accessing the data in the array.
> 
> As far as I see it, I have to add an additional item to the array data,
> storing the sort sequence of the keys, while the user creates his custom
> sequence of the words in the list field and keeping this number always
> synchronous to the line number of the fields list. So I could use this "sort
> sequence number" from the array to rebuild the same sort of the words when
> extracting the words from the array.
> 
> Would this be the best approach to keep the sort sequence of the words
> stored with the array, or do you see an easier more straight forward
> approach to keep the array "synchronous sorted" which I don't see right now?
Use the alphabetically-sorted word-list as the keys of an array.

-- MySortedList is a return-delimited list, one word per line, sorted 
alphabetically
-- UserSortedWordList is the return-delimited list of words sorted into the 
user's preferred order
put "" into WordArray
repeat for each line LL in MySortedList
  put lineOffset (LL,UserSortedWordList) into WordArray[LL]
next repeat

I'm not entirely sure that lineOffset (or even wordOffset) are the right thing 
to do here; there's every danger of encountering a Scunthorpe problem, such as 
if "pen" and "open" are both words in the list, or "squire" and "ire", etc etc. 
Hmm… maybe go with comma-delimited lists, and something along the lines of "put 
wordOffset (comma & LL & comma, comma & UserSortedWordList & comma) into 
WordArray[LL]" ?

If this is what Mike Bonner had in mind, chalk it up to my inability to 
comprehend what he wrote.
   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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

An anomaly in the "read from file" command?

2017-04-26 Thread Quentin Long via use-livecode
First off, thanks to Alan Stenhouse for zeroing in on my filter-related 
mistake. Any number fo people *could* have done so, but it was Alan who 
actually did the deed. So, yay Alan!

Second: I discovered something odd as a result of another mistake I made. My 
mistake:

ask file "What do you want to read?"
put it into DisFile
read from file DisFile until EOF
put it into fld "This Field"

What went into field "This Field" was the contents of the *variable* DisFile, 
*not* the contents of the *file* whose name is stored in the variable DisFile. 
This is because of how the pseudo-variable "it" behaves, i suspect.

My mistake was that I didn't *open* file DisFile before reading it, of course. 
And once I did open the file, the reading went on normally, and the contents of 
the field did indeed end up in the field "This Field". So, bad on me for not 
opening the file first, good on me for recognizing & fixing that lapse without 
external assistance. But I do have a question:

Why didn't I get an error message when I tried to read from a file that hadn't 
been opened yet? Shouldn't LiveCode have gotten fussy about that? 

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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

Weirdness with filter (maybe?)

2017-04-20 Thread Quentin Long via use-livecode
I have a return-delimited list. Each line of this list consists of [some text] 
& tab & [other text]. I want to see all the lines of the list for which [some 
text] contains Character String X. This is obviously a job for the filter 
command, right? So I try this:

filter lines of MyList with ("*" & CharStringX & "*" & tab)

The result I'm expecting is, a list which contains every line of MyList in 
which the [some text] bit contains CharStringX.

The result I get is, a "list" which contains zero lines.

Have tried various alternate forms of the line, including…

filter lines of MyList with ("*" & CharStringX & "*" & numToChar (9))
filter lines of MyList with wildcard pattern ("*" & CharStringX & "*" & tab)
filter lines of MyList matching wildcard pattern ("*" & CharStringX & "*" & tab)

…all of which yield the same results as the original line.

Would appreciate a sanity check: Am I missing some necessary part of the filter 
syntax? Does the filter command even know what to do with the constant "tab"? 
How *does* one filter for a pattern that includes a tab?

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: WEIRD: code changes the code instead of a field

2017-03-21 Thread Quentin Long via use-livecode
Message: 13
Date: Tue, 21 Mar 2017 14:58:02 +
sez Bob Sneidar 
> > On Mar 21, 2017, at 04:11 , Klaus major-k via use-livecode 
> >  wrote:
> > 
> > "numtochar" and "chartonum" have been deprecated since version 7.x of 
> > Liveocde!
> > So please try again with "NumtoNativeChar" and maybe also LC 9 dp6. :-)
> say WHUUUT? By deprecated, do you mean not part of the scripting language 
> anymore?? I thought we didn't do that. 
"Deprecated" doesn't mean "eradicated". "Deprecated" means "could you please 
not use this any more? there's better options available now, honest there are!"
   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: Messages sent while mouse is down?

2017-03-11 Thread Quentin Long via use-livecode
sez Tim Selander :
> I miss the Zynga "Pathwords" game on Facebook, so for my own 
> amusement I'm trying to recreate it in Livecode.
> 
> For those who don't know the game, it had a solid screenful of 
> Scrabble-like lettered tiles. Click and drag the mouse through 
> adjacent letters to make words.
> 
> Without clicking, simply moving the mouse through the tiles 
> (fields) triggers mouseenter, mouseleave, etc. which makes it 
> easy to pick up the letters.
> 
> But when the mouse is down, it seems mouseloc() is the only thing 
> I can get. Using a variable what has all the field rectangles, I 
> can use the mouseloc() to ultimately identify the field under the 
> pointer, but it's too slow...
> 
> Does a moving mouse with the button down trigger any other 
> messages besides mouseloc()?
I see that Mike Bonner has already provided a solution which seems to do what 
you want. But just in case there are other people out there who might need a 
different solution, here's my stab at it…

If you have a "screenful of Scrabble-like lettered tiles", these "tiles" are 
presumably arranged in a rectangular grid, with neatly aligned rows and 
columns. If this is the case, the locations of the row-tiles are going to be 
separated by X number of pixels, such that row-tile 1 has X-coördinate A; 
row-tile 2 has X-coördinate (A + X); row-tile 3 has X-coordinate (A + 2*X); and 
so on.

Column-tiles will work similarly. Their locations will be separated by Y number 
of pixels, such that column-tile 1 has Y coördinate B; column-tile 2 has Y 
coördinate (B + Y); column-tile 3 has Y coördinate (B + 2*Y); and so on.

If the grid's horizontal spacing is identical to its vertical spacing, the 
separation-values X and Y will be the same, of course. Given the fact that 
pixels are not *necessarily* square, it would be imprudent to *assume* that the 
grid's horizontal and vertical separation-values are identical, and I will not 
make that assumption here.

So.

My solution to Tim Selander's problem completely ignores most of the 
mouse[whatever] messages, depending strictly on mouseLoc. Like so:

local dX = 25 -- if the horizontal-spacing value is not 25, put the real value 
here
local dY = 25 -- again, replace 25 with the real value as needed
local TimeSlice = 50 -- how often, in milliseconds, the code checks the 
mouseLoc. adjust as needed for response time
local GridLocPulse

global GridCell = "1,1"

on GridLoc
  if (GridLocPulse) then send GridLoc to me in TimeSlice milliseconds
  put the mouseLoc into ThisLoc
  put (1 + (item 1 of ThisLoc div dX)) into item 1 of GridCell -- may need 
tweaking to account for edge effects
  put (1 + (item 2 of ThisLoc div dY)) into item 2 of GridCell -- ditto
end GridLoc

on GridLocOn
  put true into GridLocPulse
  GridLoc
end GridLocOn

on GridLocOff
  put false into GridLocPulse
end GridLocOff

The above code can go into the script of the card where the tile-grid lives.

Once every (TimeSlice) milliseconds, this code looks at the mouseLoc and 
converts the mouse coördinates into grid coördinates, which are stored in the 
global variable GridCell. GridCell being a global, its contents should be 
accessible to any handler in any script which includes the line "global 
GridCell".

It's probably a good idea to *not* have the GridLoc handler burning 
clock-cycles *all the time*. Thus, the local variable GridLocPulse, and the 
subsidiary handlers GridLocOn and GridLocOff. GridLocOn activates the GridLoc 
handler, and GridLocOff turns GridLoc off.

Hope this helps…

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: Dragging widgets

2017-02-28 Thread Quentin Long via use-livecode
> > On Feb 28, 2017, at 07:14 , Sannyasin Brahmanathaswami via use-livecode 
> >  wrote:
> > an image is an image is an image, whether it is png, bitmap, jpg or svg, 
> > the fact that is is a "widget" is secondary to the use case.
> 
> sez Bob Sneidar :
> au contraire. Not all images are the same. Support for each kind of image has 
> to be implemented. If the industry developed a new kind of image, LC would be 
> faced with incorporating that format. 

It's true that *under the hood*, LC must handle each distinct 'flavor' of image 
differently. But why should *the user* be concerned about whether a given image 
is vector or raster or RLE or what?

Consider: Numbers can be signed, unsigned, integer, or real, and the engine's 
internal workings must handle each of those 'flavors' of number differently. 
But in spite of those internal differences, *the expression "VarX + VarY" 
ALWAYS just works, REGARDLESS of which flavors of number VarX and VarY happen 
to be*.

As far as *the user* is concerned, a number is a number is a number, and it 
*doesn't matter* whether a number happens to be real or integer or what. Why 
can't an image be an image be an image, *regardless* of whether an image 
happens to be JPG or bitmap or what?

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: Yertle the Turtle

2017-01-31 Thread Quentin Long via use-livecode
Suggestion for RM to try: Don't fuss about non-integer points—do all the 
necessary calculations "under the hood", and just let point-coördinates be 
assigned the resulting non-integer numbers as needed. With any luck, LC will 
make this "just work" on your screen.

   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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: Not Corruption

2017-01-05 Thread Quentin Long via use-livecode
sez J. Landman Gay:
> On 1/4/17 4:05 PM, Bob Sneidar wrote:
> > I feel so stupid. But I must confess I screwed up.
> You did the right thing posting here. I have a client who runs into 
> problems all the time, so we schedule a Skype session where I can see 
> what's going wrong. Invariably, as soon as she tells me about the issue 
> and I'm watching her screen, she immediately figures out the reason 
> without my help. All I have to do is be there.
https://en.wikipedia.org/wiki/Rubber_duck_debugging
   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
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