Re: Some questions about Command-line argument parser library
Mark, thank you very much for your explanations. It works now. Would you please be so kind to also explain what for the argumentArray can be used? GetOpt(grammar [, argumentArray]) Okay, i could use it for testing in the LC IDE, so i do not need to compile and execute the standalone. But is there another scenario where it would make sense to include that array in the call? And while i am already asking... ;) The environment function can also return "development command line" The dictionary says about that : The stack is running in the development environment with the "-ui" command line option. So would i be able to run a stack by running the LC IDE with -ui, add the stack as parameter and add also command line options, which then could be parsed with getop()? Regards, Matthias > Am 18.10.2021 um 16:30 schrieb Mark Waddingham via use-livecode > : > > On 2021-10-18 15:14, matthias rebbe via use-livecode wrote: >> Hello, >> is there anyone who uses the Command-line argument parser library? >> I am not sure how i can get the value that is attached as parameter >> when the programm is started from the command-line >> Let's say i call my program like this ./myprogram -m=SomeParam >> So how do i get the value SomeParam?I thought it is in the array after >> getop() is called. >> My code looks like this >> put getopt("m,macadress") into tParams >> if "macadress" is among the keys of tParams["options"] >> then put tParams["options"]["macadress"] into tValue > > You are using it correctly - but I think you've omitted a `=` from the end of > the option specification: > > Each option specification can end with a `=`. This indicates that > the option expects an argument. For example, with the grammar > `-o,--output=`, the option can be specified like `-o file`, `-ofile`, > `--output file`, or `--output=file`. > > [ FWIW there is a 'typo' in the docs there the grammer being exhibited should > be `o,output=` I think! ] > > Warmest Regards, > > Mark. > > -- > Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ > LiveCode: Everyone can create apps > > ___ > 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: Shaping an image to fit in a polygon
Jacqueline Gay’s suggestion is excellent, and by exactly aligning the rect of the polygon with the rect of the image being “trimmed”, I can avoid having the image centered or repeated. See script below. I am still wondering what goes wrong with my alphaChannel approach to showing irregularly shaped images. Is there some imprecision in the “within” function? This would be important to know for other uses of it. David Epstein on imageToGrc gID # fills graphic id gID with image it is positioned on; works for polygon, oval, regular, or rectangle set the linesize of grc id gID to 0 set the filled of grc id gID to false wait 1 ticks # seems needed so that linesize of 0 is respected hide grc id gID import snapshot from rectangle globalRect(the rect of control id gID) put the short id of image (the number of images) into imID set the rect of image id imID to the rect of grc id gID set the filled of grc id gID to true set the backgroundPattern of grc id gID to imID show grc id gID set the loc of grc id gID to the bottomRight of grc id gID ## to make it visible hide image id imID ## note: don’t delete, or polygon loses the image choose browse tool end imageToGrc function globalRect theRect return globalLoc(item 1 to 2 of theRect),globalLoc(item 3 to 4 of theRect) end globalRect ___ 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: Some questions about Command-line argument parser library
On 2021-10-18 15:14, matthias rebbe via use-livecode wrote: Hello, is there anyone who uses the Command-line argument parser library? I am not sure how i can get the value that is attached as parameter when the programm is started from the command-line Let's say i call my program like this ./myprogram -m=SomeParam So how do i get the value SomeParam?I thought it is in the array after getop() is called. My code looks like this put getopt("m,macadress") into tParams if "macadress" is among the keys of tParams["options"] then put tParams["options"]["macadress"] into tValue You are using it correctly - but I think you've omitted a `=` from the end of the option specification: Each option specification can end with a `=`. This indicates that the option expects an argument. For example, with the grammar `-o,--output=`, the option can be specified like `-o file`, `-ofile`, `--output file`, or `--output=file`. [ FWIW there is a 'typo' in the docs there the grammer being exhibited should be `o,output=` I think! ] Warmest Regards, Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ 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
Some questions about Command-line argument parser library
Hello, is there anyone who uses the Command-line argument parser library? I am not sure how i can get the value that is attached as parameter when the programm is started from the command-line Let's say i call my program like this ./myprogram -m=SomeParam So how do i get the value SomeParam?I thought it is in the array after getop() is called. My code looks like this put getopt("m,macadress") into tParams if "macadress" is among the keys of tParams["options"] then put tParams["options"]["macadress"] into tValue But tValue is empty? I am trying this under macOS. Regards, Matthias ___ 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: IDE crashing on Windows 10
The notes for LC 9.6.5 RC 1 indicate NO support for Windows 11 whatsoever, as it also indicates no support for any Linux versions since 2016, but is very nearly uptodate re Macintosh. https://downloads.livecode.com/livecode/9_6_5/LiveCodeNotes-9_6_5_rc_1.pdf On 18.10.21 12:39, Richmond wrote: Last time I looked LC were testing their versions on some fairly old versions of Linux, so this leads me to wonder which versions of Windows they are testing on. Certainly doing almost ALL of their development work on Macintosh [even though I much prefer Macintosh to Windows] does seem a bit odd when Windows has a socking great wodge of the market share. I have had to get children who have been working with 9.6.x on Windows 8 & 10 to "pull back" to the 8.1.x series because of crashing. Richmond. On 18.10.21 11:29, Bernard Devlin via use-livecode wrote: I am wondering what is unique about my situation that LC is so flaky on Windows. No other app I run crashes like this. I honestly don't believe anyone who was new to LC would continue to use the tool if it crashed the way it crashes on me. ___ 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: IDE crashing on Windows 10
Last time I looked LC were testing their versions on some fairly old versions of Linux, so this leads me to wonder which versions of Windows they are testing on. Certainly doing almost ALL of their development work on Macintosh [even though I much prefer Macintosh to Windows] does seem a bit odd when Windows has a socking great wodge of the market share. I have had to get children who have been working with 9.6.x on Windows 8 & 10 to "pull back" to the 8.1.x series because of crashing. Richmond. On 18.10.21 11:29, Bernard Devlin via use-livecode wrote: I am wondering what is unique about my situation that LC is so flaky on Windows. No other app I run crashes like this. I honestly don't believe anyone who was new to LC would continue to use the tool if it crashed the way it crashes on me. ___ 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: IDE crashing on Windows 10
Hi Curry Thanks. It had occurred to me that it could be the SE bling that was causing the crashes. So I had switched off almost all of the bling. The crashes on clicking within the text field stopped after that - only a day or so now, but I haven't seen that kind of crash since I switched off most of the bling. However, yesterday I went to click "File/Save" on the IDE's main menu, and the IDE crashed (wiping out the work I was just trying to save). So I'm not sure if this is the same problem or a different one. If it had been the File menu of the SE itself, I might be inclined to think it was the same bug. But given it was the main File menu, I'm less inclined. I am wondering what is unique about my situation that LC is so flaky on Windows. No other app I run crashes like this. I honestly don't believe anyone who was new to LC would continue to use the tool if it crashed the way it crashes on me. If I don't get any more random crashes for a few days I plan to re-enable the bling and see if they return. I've switched off Geoff's Navigator too. So now I'm running with just a standard install. If the random crashes return then I'll create a new user and install a later version under that username. I've checked and it's not an out-of-memory situation (the machine has 8gb and only 75% of that is in use). Regards, Bernard On Mon, Oct 18, 2021 at 5:59 AM Curry Kenworthy via use-livecode < use-livecode@lists.runrev.com> wrote: > Bernard: > > > I can be in the Script Editor typing away. > > I move the mouse to click on another line > > of the script. Blammo. LC crashes. > > Any idea how this can be pinned down? > > I believe I've seen this particular crash only twice, > each time an isolated incident with no obvious pattern. > > > Yesterday I had the IDE crash five or six times > > in the middle of editing a script. > > With that kind of recurrence, a recipe should be doable! > After you finish some work, I would disable any workaround > and try to keep triggering it to find the problem. > > BTW, what SE "bling" options do you have enabled? > (I call them "bling": flashy and performance-expensive.) > I only use Control Structure Completion and Autoformat. > Colorization is also enabled, it seems OK. > > > LC 9.6.1 > > Have you tried a more recent LC version? > A few crashes have been fixed lately. > Probably not this one, but worth a try. > > (And several more are still with us, > despite the amusing skepticism > of a few "crash deniers" who later > casually admit they have crashes too!) :D > > I still need to report another crash/hang pair, > but they show up on one particular project > so I'll have to do it when I'm back on that work. > Hope it happens enough to recipe. (Or not at all.) > > Custom Software Development > "Biblical Methods, Better Results" > Christian LiveCode Training and Consulting > http://livecodeconsulting.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