Shop OBEX P1 Docs P2 Docs Learn Events
SpinEdit - Editor for Spin, Spin2 and FastBasic - Page 4 — Parallax Forums

SpinEdit - Editor for Spin, Spin2 and FastBasic

124

Comments

  • I'll have to check my version of PST. It's probably out-of-date.

    RE: file behavior. What would really be nice is if you could detect if an opened file has been saved elsewhere. I realize that's a HUGEEEE ask, but it's one of the things I love about Notepad++. I'd imagine it's a nightmare to implement though.

    I like your ideas regarding debug. It doesn't really need to take input but having an easy way to view output would be really sweet.

    The improvements to find are great. This is shaping up to be a great tool indeed!
  • Checking the if the file last write timestamp has changed isn't that complicated is it?
  • bozobozo Posts: 70
    edited 2019-12-05 10:21
    I like it.

    But I am having trouble loading to P2 ES Rev B (EEPROM), and I'm getting the attached response.
    Can someone tell me what I am doing wrong?

    clues:
    the DIP switches are set to OFF, except for FLASH, which is set to ON
    Code compiles OK
    The same code compiles and loads OK using FlexGUI.
    command line is /C loadp2.exe -m 010c1f08 -p COM3 "E:\propeller\P2\code\Spin2Edit2.binary" > loadp2.out

    but note:
    If I flip the FLASH switch to OFF and load to RAM, all is OK.
    If I then flip the FLASH switch back to ON and load to EEPROM, it works. But once only.
    All subsequent loads to EEPROM fail as described above.

    any help welcome

    cheers, Mark
    344 x 130 - 17K
  • RaymanRayman Posts: 13,797
    Thanks for trying spinedit.
    Yes, flash loading needs to be fixed for rev.b silicon...
    Should have it done very soon.
  • RaymanRayman Posts: 13,797
    edited 2019-12-05 19:58
    I think I have the flash fixed now thanks the ericsmith and evanh.

    New version in top post with new loadp2.exe, spinedit.exe and flashloader.bin
    Update: Just fixed something with the C options dialog...
  • thx Rayman, that's fantastic. Works OK now.
  • dgatelydgately Posts: 1,621
    edited 2020-01-01 18:23
    Found an issue how SpinEdit finds the compiler & loader... Depending on what directory SpinEdit is located, the compiler & loader cannot be found. I receive errors like:
    fastpin.exe is not recognized as an internal or external command
    
    as, SpinEdit thinks the compiler is in my Desktop directory. Since I'm running WIN 10 in a Parallels VM, the problem may be made worse (I have file sharing across macOS & WIN 10 turned on).
    Screen%20Shot%202020-01-01%20at%2010.21.12%20AM.png
    When I update the Command Line Viewer field "Working Folder", to point to the bin directory, where fastspin.exe is located, it works "one time". I have to re-edit that file for each compile.

    Should there be a Preference that sets compiler & loader paths that become permanent, as in SimpleIDE or PropellerIDE? It would help especially on atypical systems like WIN VMs!

    dgately
  • RaymanRayman Posts: 13,797
    Ok, maybe something like a checkbox and a text input for "Set specific compiler/loader folder", right?
  • RaymanRayman Posts: 13,797
    Actually, I should be able to find out the folder of spinedit.exe automatically...
  • Since WIN is a mystery to me (as macOS is a mystery to others), where should apps like SpinEdit be installed? Apps with installers get placed in Programs or Programs x86, but apps that are just downloaded as a single .exe are less determinant in location (as far as I can see:-). I copied SpinEdit.exe into flexgui's bin directory, in order for it to use fastspin, loadp2, etc... But, that was only partially successful for compiling C, Spin & BASIC sources. I still needed to mod the Command Line Viewer for C & Spin libraries. flexgui allows a list of library directories to be input. Perhaps that's a good model.
  • RaymanRayman Posts: 13,797
    I think the files can be put anywhere. But, if you manually put them in a "Program Files" place, strange things may happen if you don't do it as Administrator...
    So, I think I'd avoid putting them in Program Files, until I maybe make an installer one day.
    For now, I'd just make a folder anywhere else and put all the files there.

    Can you try the attached and see if you can specify a "tool" folder where the .exe files are using the "Options" dialog?
  • Rayman wrote: »
    Can you try the attached and see if you can specify a "tool" folder where the .exe files are using the "Options" dialog?
    Yes, once a path for the tools is set, it compiles and continues to compile when SpinEdit is restarted!

    Thanks,
    dgately

  • RaymanRayman Posts: 13,797
    Great! It might actually be useful for me too, to keep these things in a separate folder...
  • JRoarkJRoark Posts: 1,214
    edited 2020-01-16 15:04
    @ersmith I just found a little gem. Eric is likely sitting there going "well.. yeah... of course that works!", but I was pleased to find this works in FlexBASIC.

    You can copy the entire contents of a structure (defined as a class) from one instance of the class to another with one line of "magic" code. Consider this code:
    CLASS myTimeStruct
       dim time as long
       dim date as long
       dim GMTOffset as long
    END CLASS
    
    dim Time1 as myTimeStruct
    dim Time2 as myTimeStruct
    
    Time1.time = 5000
    Time1.date = 7429522
    Time1.GMTOffset = -6
    
    Time2 = Time1   '<-- "magically" copy Time1 into Time2
    

    We expect stuff like this in the "big machine" implementations of a languange, but I sure wasn't expecting this in FastBASIC. Ya gotta put this gem in the manual! :)
  • RaymanRayman Posts: 13,797
    I'm not sure ersmith monitors this thread, but that is interesting.

    But, is it really copying the contents of the structure?
    Or, is it merely making Time2 point to the same existing data?
  • Rayman wrote: »
    I'm not sure ersmith monitors this thread, but that is interesting.
    Good point. Usually if I tag him, he sees it. If not, I'll PM him.
    Rayman wrote:
    But, is it really copying the contents of the structure?
    Or, is it merely making Time2 point to the same existing data?

    I just verified it, because you raised a point that I didn't initially test for (and in the process I found a bug I need to report to ERSmith).

    I can say with certainty that Time2=Time1 is actually copying the data, and not just adjusting changing a pointer. After we set Time2=Time1, we can still manipulate the data fields in each independently of the other. Changes made (after the copy occurs) to Time1 don't propagate to Time2, and vice versa.

    Pretty cool!

  • The assignment does do a copy (it turns into the equivalent of bytemove() under the hood). @JRoark , the example you posted doesn't compile as-is in FlexBASIC, as you found out:

    (a) fastspin doesn't like the variable declarations in the CLASS (it wants them prefixed by DIM). This some laziness on my part in the parser and it's easy to fix it so that inside CLASS the DIM isn't required, so I'll do that

    (b) there's a bug in handling objects of sizes between 5 and 11 bytes (inclusive) due to some unfinished code to convert between structures and multiple values. That's in the "todo" queue but it's not finished yet.

    Getting back on topic a little bit, @Rayman are you building fastspin and loadp2 yourself from source or do you rely on my pre-built binaries? If the latter then PM me and I can send you a more recent build for you to try in SpinEdit. I don't think anything has changed in fastspin that should affect the editor, but the new loadp2 features like scripts and multiple binary downloads might be useful for you.
  • ersmith wrote: »
    The assignment does do a copy (it turns into the equivalent of bytemove() under the hood). @JRoark , the example you posted doesn't compile as-is in FlexBASIC, as you found out.

    Yup. You must have seen the post before I corrected it. I later added the DIMs to make it cut/copy/run properly. My bad. :)
    ersmith wrote:
    (a) fastspin doesn't like the variable declarations in the CLASS (it wants them prefixed by DIM). This some laziness on my part in the parser and it's easy to fix it so that inside CLASS the DIM isn't required, so I'll do that
    Actually, if my vote counts, I prefer that any variable that gets declared anywhere should be prefaced by DIM for clarity. Maybe make DIM optional within a CLASS? (Confession: I have an external parser that does some housekeeping things like identifying variables and making a list of them. It is a lot easier to trigger on VAR and DIM than it is to have to do intelligent parsing like a compiler would).



  • JRoark wrote: »
    ersmith wrote:
    (a) fastspin doesn't like the variable declarations in the CLASS (it wants them prefixed by DIM). This some laziness on my part in the parser and it's easy to fix it so that inside CLASS the DIM isn't required, so I'll do that
    Actually, if my vote counts, I prefer that any variable that gets declared anywhere should be prefaced by DIM for clarity. Maybe make DIM optional within a CLASS?
    Sorry yeah, I should have been clearer -- I'm planning to make the DIM optional within a CLASS (so FreeBasic declarations would work). So your existing code should continue to work, and you can continue to use DIM everywhere if you want to.
  • RaymanRayman Posts: 13,797
    ersmith: I think I am using a recent version myself, I just need to post a more recent version of everything to the top post...
  • Support for PASM?
  • RaymanRayman Posts: 13,797
    Do you mean for P2?
    This uses FastSpin to compile P2, .spin2 code.
    FastSpin supports both pure PASM2 and also a Spin with PASM2
  • Yes and thanks
  • RaymanRayman Posts: 13,797
    edited 2020-02-14 14:20
    Now that Spin2 is out, there may be major changes coming to FastSpin.
    So, I just posted current version of SpinEdit to top post, while things are stable.

    Now has Flow Indicators, font size control and brightness slider.
    The brightness slider is nice if you can't find your mouse cursor... Making it brighter makes it easier to see the cursor.

    Also, this is a "release" build instead of "debug". Should be better for very large files.


    BTW: I'm glad to hear that Parallax is going to come out with a new Propeller Tool with P2 support.
    Takes the pressure off of me to fix whatever bugs might be here...

  • @Rayman Since PNut has a CLI, have you considered allow it to be used as the compiler?
  • RaymanRayman Posts: 13,797
    edited 2020-02-29 00:55
    I added it a couple weeks ago...
    It's not very useful without any diagnostic output, but I can post a version with it here.
  • RaymanRayman Posts: 13,797
    This version has PNut option for run and flash. Compile was there, but I took it away because it didn't used to be an option...
  • RaymanRayman Posts: 13,797
    You have to rename compiler to PNut.exe and put in same folder...
  • bozobozo Posts: 70
    edited 2020-03-11 09:45
    Hi all, I'm having a problem with indentation with nested repeat loops (see attached).
    The last 3 statements belong to the middle repeat loop but the editor doesn't show them as such and they don't execute as such.
    Am I doing something wrong with the indenting?

    I added red dots where I expected the indentation marking to appear.

    cheers,
    Mark
  • RaymanRayman Posts: 13,797
    Thanks, I’ve also noticed some flow indicator errors with nested loops.

    Maybe one day I’ll fix it....
    It’s harder than it looks though..
Sign In or Register to comment.