I'm glad you were able to solve this. I don't know why you'd think that the Commander has the caption "FMSLogo". When it's docked, it doesn't have a caption. When TEXTSCREEN or FULLSCREEN is used, the caption is "Commander". The window that has the caption "FMSLogo" is either the overall window or the window that holds the drawing surface. This is somewhat irrelevant because "FMSLogo" is a special case that always gives focus to the screen. This is hard-coded into graphwin.cpp: NODE *lsetfocus(NODE...
Well, here is finally the solution to the riddle:: (KEYBOARDON [IF EQUAL? 27 KEYBOARDVALUE [ SHOW [ESCAPE Pressed] ]] []) SETFOCUS [FMSLogo] Now it works! But what the documentation says is that the screen should have the focus, but isn't it given to the commander by SETFOCUS [FMSLoco}? ~~~ The "Screen" must have focus (NOT the commander) You can force this by calling SETFOCUS [FMSLogo] after you call KEYBOARDON ~~~ Who is who and what is what? Does the caption FMSLogo mean the screen or the commander,...
I'd like to make the proposal to add a link to KEYBOARDON at SETFOCUS and GETFOCUS - or to explain a little more about FOCUS at SETFOCUS and GETFOCUS.
Now I found some answers in the description of KEYBOARDON itself: Note the "Screen" must have focus (NOT the commander) to catch the key events. You can force this by calling SETFOCUS [FMSLogo] after you call KEYBOARDON. All the "callbacks" for the keyboard are automatically run in NOYIELD mode. But if the Screen needs the focus, why will I have to write SETFOCUS [FMSLogo] after KEYBOARDON and not SETFOCUS [screen]? I think, Copter works in Little Helper because there was the right focus by lucky...
To solve the KEYBOARDON-Problem, I need to know everything about Focus in FMSLogo. the documentation of SETFOCUS and GETFOCUS is not very clear, so I cannot be sure what to answer to the following questions: 1. Is FMSLogo the caption (title) of the graphics area or of the commander? And how is the other one, the contrary, called? 2. Are there still more possible captions. and which is the complete set? 3. Which are the consequences of setting the FOCUS to a special caption? 4. How can I find out,...
Good news! We went back to our former copter project where a model copter is flying over air photos of our region controlled by arrow keys. We then implemented this unfinished project into a Little Helper environment before we put it into an archive and now managed to transfer it to the actual Little Helper successor four years later, where the development can be continued as soon as we have time for it. So, now we can figure out why the copter works with KEYBOARDON other than our new procedures....
Sorry, I forgot what I really copied. It was: (KEYBOARDON [IF EQUAL? 27 KEYBOARDVALUE [ SHOW [ESCAPE Pressed] ]] [])
Thank you for the examples. Nevertheless, frustration goes on. I copied exactly the following to the commandline on two different machines (notebook and desktop) WINDOWS 11, FMSLogo 8.3.2 and 8.4.0 original. Well, the input was echoed, but when I pressed ESCAPE, there was no reaction whatsoever. The focus was FMSLogo. I tried the same with ENTER and arrow keys, but the answer was nothing at all. Regarding all the complicated things I did in the last days with mouse and TIMER, where FMSLogo followed...
I just tested FMSLogo 8.4.0 and KEYBOARDON was able to react to the Escape key on my machine. The easiest way to see KEYBOARDON work is to have it print KEYBOARDVALUE in its callbacks: (KEYBOARDON [SHOW SENTENCE KEYBOARDVALUE "down] [SHOW SENTENCE KEYBOARDVALUE "up]) Here's a simple program that prints when Escape is pressed: (KEYBOARDON [IF EQUAL? 27 KEYBOARDVALUE [ SHOW [ESCAPE Pressed] ]] []) Since you mentioned that the things you were doing were complex, it might be worth starting with just...
Keyboardon doesn't react
Thank you, David, for your answer. You made it clear that widgets on the graphcs screen are not compatible with ZOOM. This is regretable, but no disaster. I can still use a window as parent of the widgets, even if that is not so smart and comfortable as using them directly on the graphics screen. But it's good enough. When using a window, I'll have to rely on dialog units, but you already gave us a procedure to handle them, which worked perfectly already over years. Concerning the possibility to...
Thanks for the corrections, Daniel. I committed them as [r6107].
Fix some Spanish grammar in the "Pause Mode" dialog.
It's true that the dialog widgets that are placed on the drawing surface are incompatible with ZOOM. The feature request you made, to have the current ZOOM level be available by MACHINE makes sense to me. If ZOOM had followed Logo conventions, it would have been named SETZOOM with ZOOM outputting the current zoom level. It's too late to correct that now. Your idea of adding it to what MACHINE outputs has minimal risk to breaking backward compatibility, so it's something I'd be willing to implement....
Thanks David, Sure: El programa que se ejecuta actualmente está pausado. Cuando FMSLogo está pausado puedes ejecutar cualquier instrucción que quieras, incluidas las instrucciones para inspeccionar los valores de las variables locales, reanudar la ejecución, o detener el programa por completo. Ejecutar Reanudar la ejecución justo después de la instrucción PAUSA Sigue
PAUSE should have self-documenting GUI
I have finished implementing the dialog box, as describe. This is committed in [r6106]. This will be first available in FMSLogo 8.5.0, which has no planned release date. I translated it to Spanish but not any other languages. Daniel, you might take a look at the attached screenshot of the Spanish translation, since I'm not a native speaker and don't know the natural way to say that execution is paused.
Implement Feature Request #136; the PAUSE dialog now explains what pause mode is and what you can do in it.
Regretably there are more problems when using ZOOM. We created a BUTTON with the FMSLogo screen as parent. And it worked womderful when ZOOM was 1. But as soon as ZOOM got another value, say 2 or 0.5, the BUTTON went crazy. First I thought, that it was gone, but it only jumped away in an unpredictable way. It did not simply scale like the ZOOM nor did oit keep its original size. Well, so I thought, it would be bettwer to create an own window for this button. This is not really smart, and it has another...
I see. I've got still another question concerning ZOOM. As ZOOM can be used both, interactively and programmatically, the program cannot know whether during the run an interactive ZOOM has been performed. So it would be better, if the program could ask internally for the current size of ZOOM. When items 16 and 17 were added to MACHINE, it allowed us to see from our procedure where the scroll position has gone, and we used this often since then. So I ask, whether there is a possibility to find out...
I'm not sure what you're asking, but swapping the order of running BITLOAD and ZOOM shouldn't change the outcome. BITLOAD copies the image to the drawing surface at the exact size of the image. ZOOM changes how much of the drawing surface you see, but it doesn't change what's on the drawing surface. If you BITLOAD while zoomed out or zoomed in and then you run "ZOOM 1" to get back to the 1:1 size, it'll be as if you never had zoomed. You'll see this behavior for all drawing commands, not just BITLOAD....
Smart image handling in FMSLogo - responsive design.
The text processing inherited from MSWLogo doesn't lend itself well to cool text games. The main problem is that the input is done with modal dialog box, so a text conversation is more awkward than it is in UCBLogo. Another problem is that TYPE doesn't type anything until it gets a newline. In short, I think there's more than just SETTEXTCOLOR that stands in thew way of cool text games. It's good to hear that you're a programmer. Feel free to submit a patch. Please include documentation and tests....
Exactly; I felt like I was facing a chicken-and-egg scenario where I couldn't access the %TEMP% variable in order to safely write a temporary file; if I could write a temporary file, then I could access environment vars via outputing to %TEMP%/logo-output-TIMESTAMP.txt. With your hints on using DLLCALL to access the Windows API, I can get an egg to hatch a chicken with, to then get more eggs. Thanks.
Didn't know that double-clicking a .lgo file would start FMSLogo in that file's directory; thanks! That would solve my use case, but I think I'll still go with the option of telling parents "Here's the zip file, unzip it in this directory" because that will allow me to preload the zip file I distribute with a startup.logoscript file that automatically records a transcript, plus I can add a few functions (like GETWORKINGDIRECTORY) to the logolib directory in the .zip file I distribute. (I wouldn't...
This sounds like a reasonable request. In the meantime, I think you can implement it yourself. You can prefix your shell command with cmd /c and then redirect stdout and stderr to files, read the files into variables, delete the temp files, construct the list, and output it. If you get this working, please post it here. As a proof-of-concept, this following created a file named tmp-output.txt in my user directory. show shell [ cmd /c dir /w > c:/users/david/tmp-output.txt ] You may have to worry...
Thanks for the request, Robin. This looks a subset of Feature Request #13. The reason I don't new primitives lightly is that any new primitive risks breaking existing logo programs that happen to have a user-defined procedure of the same name. Changing an existing procedure from printing something to outputting something is even more of a risk, because older programs would get a "you don't say what to do with" error. The most straight-forward way to get the current working directory or an environment...
Actually, my use case is probably better served by downloading the FMSLogo .zip file and having students run FMSLogo from the zip. Then they'll automatically have write access, I can customize the .zip file ahead of time to contain a startup.logoscript that runs DRIBBLE so I automatically can see a transcript of each student's activity, and so on. But I still think a PWD function is needed, so I'll leave this ticket open.
SETTEXTCOLOR procedure similar to what UCBLogo has
I also would like a GETENV procedure (function, really), but if SHELL would output the stdout of what it ran then the absence of GETENV could be worked around with MAKE "CWD SHELL [ CMD /C "ECHO %CD" ], since the CD environment variable is guaranteed to contain the current working directory. This would also be a viable workaround for my request from #140.
SHELL should output the stdout and/or stderr of the process it launched
Add PWD or similar function to get working directory
Of course. On the other hand, FMSLogo wouldn't offer the features of prefix notation if it were simply to be replaced by infix operators, which we are accustomed to in Western Europe and elsewhere in the world. Prefix notation fits well with a purely functional concept and integrates operators well into a worldview dominated by functions and procedures. Since FMSLogo did incorporate this possibility, it should do so consistently and in an optimized manner. Therefore, I continue to advocate for a...
Daniel Ajoy wrote: When I saw it, what I thought of was that navigating it using TABs is equivalent in this version as before. If you look carefully at the screenshot, you'll see that I added some underlined letters to the button text. These are keyboard shortcuts. In English, Alt+c (or Esc) will continue. Alt+t will halt the program. So a power user is only two keystrokes away from the button they want.
I don't think so. That is what + / - * > < are for.
I think it's better. When I saw it, what I thought of was that navigating it using TABs is equivalent in this version as before. I think it is illustrative that the button says throw "TopLevel
Another possibility is to have the button text be the Logo instruction and have additional explain text next to the button that ties the button to the text in the overall explain text. What do you think of this screenshot? Better or worse than before? I expect that that a user will read the overall explain text at most once in their life. The text next to the button might be read more than once. This has a slight advantage of educating the user about Throw "TopLevel, even if they never click it....
Thanks for the clarification—I'd already thought of something like that. I've worked in empirical social research for a long time and have developed programs for it with FMSLogio for over a decade and a half. There are different scale levels. Nominal, ordinal, and continuous are a rough classification, with a slider being well-suited for the last two. Ordinal scales include the well-known Likert scales, which usually have three, five, or seven levels. David's FakeSlider is well-suited for continuous...
I forgot to mention...the fix will be available in FMSLogo 8.5.0.
APPLY doesn't copy its inputlist input when running a primitive -- list may be modified
I have committed a fix as [r6105]. This fix is similar to what UCBLogo does, but the argl list is only copied when the function is a primitive, as only primitives have the potential to modify the arguments.
Fix Bug #602; APPLY with a primitive now copies the inputlist so that it can't be modified.
Manfred Asks: How is the length of the bar relative to the range being calculated, and how can I influence its length in a reasonable way? It's not something FMSLogo does directly, so it's either something wxWidgets is doing or something Windows is doing. As you noticed, the thumb is smaller if the range is larger, so if you multiply the min and max values by 100, you should consistently get a small thumb. If you look at the FakeSlider example I posted earlier, you'll see that's exactly what I did....
Now I found out what my problem when using a scrollbar as a slider really is. Combining static and scrollbar widgets is already proposed in the Help-description of scrollbar - and therefore it's not so difficult to have all three numbers (begin, current, end) together with the scrollbar-image. It's just a little fumbling, but I'd not even call it a fake. And it would be easy to write a procedure with proper inputs to do all the work reasonably. My problem is THE LENGTH OF THE BAR in the scrollbar...
Add unit tests for SUBSTRINGP
After this is implemented, some of the test code can be cleaned up. This is in predicate.lgo because there's no support for literals FAILIFNOTTRUE [MEMBER? "|| (LIST "||) ] ... LOCALMAKE "arrayofemptystring ARRAY 1 SETITEM 1 :arrayofemptystring "||
Fix an example in the documentation for MEMBER.
Add tests for MEMBER
Add more tests for MEMBERP based on a recent code review.
Improve a comment
Vilim writes: Copying the arguments into a new list would nullify all the sound uses of the argument modification pattern, like preserving invisible modifications like string interning and conversions to numbers. I don't think that happens. It looks like it happens if you read the source code, but I wrote a more straight-forward version of your repro steps: to abc show memberp "a "abc end abc abc Then I set a break point in lmemberp. It's args parameter was a different pointer each time. That is,...
Copying the arguments into a new list would nullify all the sound uses of the argument modification pattern, like preserving invisible modifications like string interning and conversions to numbers.
When comparing the UCBLogo source code to FMSLogo's source code, I saw a difference at begin_apply in eval.cpp. Changing text assign(argl, cadr(val)); to text assign(argl, append(cadr(val), NIL)); fixed the bug for the repro you gave. The use of appendwith a NIL argument is mysterious and has no comment to justify it. cadr should be the parameters to MEMBERP. append with a NIL second argument will create a new list, but there are clearer ways to do that. I don't know if this is the right fix, or...
When comparing the UCBLogo source code to FMSLogo's source code, I saw a difference at begin_apply in eval.cpp. Changing text assign(argl, cadr(val)); text assign(argl, append(cadr(val), NIL)); fixed the bug for the repro you gave. The use of appendwith a NIL argument is mysterious and has no comment to justify it. cadr should be the parameters to MEMBERP. append will create a new list, but there are clearer ways to do that. I don't know if this is the right fix, or if the real problem is as you...
MEMBERP and SUBSTRINGP unsoundly modify their arguments
Nice bug report. This is not reproducible in UCBLogo, which means we just have to figure out how Brian fixed it and merge that change into FMSLogo. Why do you think this is due to MEMBERP modifying its argument and not some interaction between APPLY and FPUT? Were you part of the bug fix in UCBLogo?
MEMBERP and SUBSTRINGP unsoundly modify their arguments
Still concerning the slider: This fake slider seems not so bad, but I think I'll prefer a simpler workaraound which may even be easier for the user: Offering her or him a list of ordered numbers to choose a level or - instead - a list of stimulating verbalized intensities (not more then 5 or - in the case of the trees - 7). So I can implement the funny fractal trees in FMSLogo in order to discuss it in school.
Yes, that's all true. And concerning Wine - we tried it on the Raspberry Pi successfully, and I'm sure, we could do the same things on Linux. My son Sascha fom time to time experimented with Finstalling FMSLogo on Linux and told me, it's not so far away. I've been using FMSLogo for decades and believe—also considering other Logo versions and languages from the JavaScript environment—that I was right for pbreport to place our trust in FMSLogo. Since the pandemic, we've been working on maximizing our...
Manfred writes: Terrapin and its also offered "Kinder Logo" as well as NetLogo seem to have no problems with platforms like Mac, Windows, Linux, Raspberry Pi, and not even the Web, but they claim that they all are based on the Java Virtual Machine JVM. Would this be possible for FMSLogo, too? I'm not sure what you're asking, but if you're wondering if FMSLogo runs natively on anything other than Windows, the answer is no. The port to Linux is about 70% complete but won't be done any time soon. Daniel...
Manfred writes: But as a slider, it should have a vertical marker at x or a horizontal bar that ranges from 0 to x. There should also be numbers at the beginning and end that indicate where the slider extends from and to, and if possible, a number for the current position. You can use STATICCREATE to put labels on the scrollbar. Here's what I came up with To FakeSlider WindowDelete "main WindowCreate "main "window [Slider Sample] 100 100 140 80 [FakeSliderSetup] End To FakeSlider.ScrollbarPositionUpdated...
Here's the continuation. From time to time we experiment with other Logo implementations. One of them id Netlogo, and today I sent a screenshot of a fractal project in NetLogo. As NetLogo is domain specific expecially for simulations with many turtles, we created a lot of very different fractal trees with random parameters, reaching over the whole year of a group of trees. Netlogo has all its widgets in a left dialog window, and I can collect them using a menu option which is opened in the attached...
Here again you find a screenshof of the FMSLogo Menu - Set - Pencolor,
Slider in a Dialog Window
To whomever it may concern, especially David and Daniel. I'll stick to this: - FMSLpgp doesn't have a slider widget. - FMSLogo needs a slider widget. You could say: It has a slider widget, but it's hidden as a scrollbar. 'I've tried it, but I have to say: This scrollbar isn't a slider widget because it lacks the proper marker. What it does have is a bar that shows the relative length and position of whatever is being scrolled. But as a slider, it should have a vertical marker at x or a horizontal...
I can't say that I understand your question, but SCROLLBARCREATE can be used to make a scrollbar that acts as a slider and runs an instruction of your choice whenever its position is moved, including one that would re-render the screen based on a time-point in the model simulation. You could use SETTIMER to advance it the simulation automatically if you want to show the simulation playing across time. As you know from your little-helper application, if you want to create a non-modal dialog box, you...
Slider in a Dialog Window
It seems to me that the Logo turtle generates some kind of vector graphics in disguise and should better be directly be implemented like that. This could make things easier even for animation, because there is the animate element in svg which allows to alter parameters over time like in CSS. And in Python there is a library svgwrite which can do reduced svg graphics and animation. Perhapt such a library could be made für FMWLogo, too. I think that no renderer is necessary - it would suffice to let...
I can remove it if you like. I don't have a strong opinion either way. I might be able to make "Continue" work, if I link the word "continue" with the concept of resuming execution in the explain text. Maybe something like "Continue right after the Pause command"
Daniel Ajoy writes: I guess it is almost harmless to keep the X. I can remove it if you like. I was just explaining why I had kept it. But I agree, the only harm that I can see of keeping the "X" is if it confuses users into thinking that it does something different. I think I prefer the label CONTINUE instead of "Resume Execution" That's what I started with. Then I changed it to "Continue" because all-caps looked ugly in the UI. I also wondered if the procedure name wouldn't be clear, which is part...
I'm still working on the overall wording. It generally means "dismiss the dialog box without making a change". While this dialog has no explicit "Cancel" button, the previous version used made CONTINUE synonymous with Cancel. Knowing this, do you still want me to remove the "X" and the Esc keyboard shortcut? I guess it is almost harmless to keep the X. However, the commander has had an "Execute" button since MSWLogo, so I kept the new dialog box consistent with that. In fact, I wanted to also have...
Daniel Ajoy writes: However, there is a typo, it says insrtuctions Thanks. I'll fix that. I'm still working on the overall wording. I also want to include that errors are ignored. I may even try to get the name of the function that ran PAUSE into the dialog box, but this is surprisingly difficult. There is an X in the upper-right corner, presumably to Close the dialog window. It seems it does the same as Resume Execution. Can it be removed? (thinking that, why have two UI elements that do the same...
In particular, the Bitmap API, FILL My thinking is that a first step that could provide better compatibility with a SVG (and EPS) library, is the incorporation into FMSLogo of a new primitive that draws colored polygons without having to move a cursor into the polygon. It's my impression that such feature usually comes incorporated into C++ graphic libraries and it matches EPS commands and SVG commands (polygon). Later, teaching materials can promote the use of only that command to draw polygons...
Here's a prototype (and screenshot) of what you requested. "Resume Execution" executes continue and "Halt Program" executes throw "toplevel. I also made it so that the executed instructions get printed to the commander history. Thanks David, I like this feature. However, there is a typo, it says insrtuctions Attached is how it looks in my computer. There is an X in the upper-right corner, presumably to Close the dialog window. It seems it does the same as Resume Execution. Can it be removed? (thinking...
Here's a prototype (and screenshot) of what you requested. "Resume Execution" executes continue and "Halt Program" executes throw "toplevel. I also made it so that the executed instructions get printed to the commander history. I'm considering making this more transparent by removing the "Resume Execution" and "Halt Program" buttons and adding links to the part of the text that explains what you can do. Clicking on the link would then replace the input control with continue or throw "toplevel, but...
Future of FMSLogo: Our extensio0ns and what about svg in the future?
This is a duplicate request of Feature Request #50. Thanks for posting the SVG library, Daniel. The link you added to Feature Request #50 no longer works, so it's good to have the original paper. I still agree with what I wrote in 2006, which is that it's better to prototype this as a library first, than to change FMSLogo, which would create a perpetual backward-compatibility obligation. I'm skeptical that SVG can be supported by default without breaking compatibility with existing programs. In particular,...
Procedures defined with DEFINE don't display properly wih POPS
I had seen this before but never thought it was a bug; I just thought just part of how DEFINE behaved. But now that you mention it, I agree that it's a bug. I reproduced the same behavior in MSWLogo 6.5b. UCBLogo 6.2 behaves correctly. A slightly more targeted repro is to use PO "ABC
Lately I've been experimenting with producing LibreCad multi-commands which can then be imported into a recent version of LibreCad and produce drawings that way. Those can be saved to DXF (autocad), SVG, EPS, or edited there.
Something derived from that, is this (haven't tested it):
There is library for that, attached.
Procedures defined with DEFINE don't display properly wih POPS
Future of FMSLogo: Our extensio0ns and what about svg in the future?
Thanks for the additional information, Daniel. I've simplified your original example to to a :a (show (b) :variable) end to b output run [c 100] end to c :variable output run [apply [[E] :E] [1000]] end a 1 1000 100 To break down the behavior, apply [[E] :E] [1000] should evaluate to 1000. Therefore, c should also output 1000, which means b should also output 1000. It's clear that a 1 should throw an error, as :variable has no value in a. Somehow the stack frame for the RUN/APPLY makes it to a. I...
another weird thing is that the value of captured is only wrong in the first show line, but not the last line show :captured below: to b :captured (show (ponA [[[E] :E] 1000]) :captured) show :captured end b "hello 1000 [[[E] :E] 1000] hello
Yes. that interpretation is correct. What's more, if I change the "b" procedure in this way: to b :captured (show (ponA [[?] 1000]) :captured) end The problem vanishes: b "hello 1000 hello I changed this [[E] :E] to this: [?] I'm not sure if this helps pin-point the problem or not.
The example isn't self-evident. I suppose you're saying that the :captured argument of disruptor should shadow the :captured in b and therefore its assignment should not affect the value of :captured in b.
Inner procedure call modifying variable in outer scope
I have documented how to exit pause mode in [r6099].
Add more information to documentation for PAUSE, including how to exit pause mode.
Fix a comment
Fix a comment
David Costanzo wrote I think a Halt button would make more sense than a THROW "Toplevel since Halt is already a familiar concept and is what Cancel on READWORD does. I started working on this and discovered why HALT doesn't work. PAUSE will print and ignore all errors that any instruction has. From lpause() in error.cpp: else if (Error.Equals(throw_node)) { // There was an error in the instruction that the // user provided. Print the error, but remain in // pause mode. err_print(); stopping_flag...
There's a similar problem in NAME, except that its parameter names were selected to be unlikely to shadow a programmer's names. If QUEUE/DEQUEUE is rewritten to be a marco, it makes sense that NAME should also be rewritten. to name :name.value.input :name.variable.input make :name.variable.input :name.value.input end
This means, there are structural differences in two versions that look the same when printed. Yes, that can happen whenever you use vertical bars or backslashes to escape a special character. Brian Harvey (also a teacher) made an intentional decision to make PRINT and SHOW render a friendly form that ignores structural differences. PON shows a more honest form. I'm not an educator, so you might ask Brian for advice on how to teach this difference, as the same behavior exists in UCBLogo. Here's a...
Hi Derek, It sounds like you have insight into the way schools work and have a professional stake in getting schools to use FMSLogo. What's stopping you from joining the project and contributing an MSI or doing the work and paying the fees to publish in the Microsoft Store? -David Costanzo
Remove trailing whitespace from the text of LOCALIZED_UNSAVEDCHANGES_MESSAGE1.
Strip trailing whitespace from localizedstrings-*.txt to stop it from re-appearing in localizedstrings-*.h after running mklocale.pl.
Strip trailing whitespace from mklocale.pl so that it doesn't re-appear in the generated internationalizedstrings.h.