Hello all
GavinWraith (26) 1563 posts |
I am not surprised that the fountain website makes frequent mention of regex s. Converting data from a textual format, such as fountain, to another format (e.g. pdf) is going to need plenty of pattern matching and capturing subexpressions. The languages that provide this are scripting languages, e.g. AWK, Lua, Perl, Python, which are available on RISC OS. If you want to match patterns outside the class of regular expressions then you will need to go to parser-expression grammars, such as RiscLua’s lpeg library. Programming with patterns is quite tough; it is something that older programming languages, such as BASIC, never provided. Re-inventing the wheel would be even tougher. See |
Steve Pampling (1551) 8170 posts |
You could look at a text editor that does scripting. I will suggest StrongED before Fred wakes up and enters the conversation. Mode extensions should be a good first step for you.
That’s not a forum timeout, it’s a “feature” of the Beast which seems to mean that the slightest glitch in connection disconnects your session.
|
Phil Hanson (2558) 75 posts |
You could look at a text editor that does scripting. I’m a fan of apps that do one thing and do it well. For instance in this one there would be no choice of font. And this is way beyond where my Basic adventures are at now but, is there a way to autosave to the file system periodically without prompt or control from the user? |
Rick Murray (539) 13840 posts |
Wasn’t there an HTML editor a while back that did something like this? So… Yes… It will be possible, but could be interesting to implement well. For example, you will need to work out what bit of the output display has changed to set up a redraw for that and only that (too much and it risks flickering).
Ah. A file format. I take it it’s a lame spec? |
Phil Hanson (2558) 75 posts |
Final Draft is one of the apps that because it’s dominant in it’s field, continues to suck and no one can do anything about it. It’s just horrid to use. Hence wanting to write in something enjoyable then exporting to a format people who don’t know any better use. :) |
Rick Murray (539) 13840 posts |
My software to parse HTML (and Scripter) was written in C, with my own parser. The Scripter part, my own design, was simple (and it is pretty rigid so faults can be given for bad markup). The HTML parsing side? Bleedin’ nightmare. I really didn’t know there were so many ways to spell fuchsia (!) and a perusal of GeoCities provided plenty of examples of really bad HTML to stress-test the code. That and the abysmal mess that the BT site was in 2001 (has it improved?). If the script markup is rigid and errors not tolerated, it shouldn’t be too hard to parse. If it is a loose spec, or differing levels of compatibility, and/or errors should be handled gracefully, the more the parser needs to do, the more it will hurt to write it.
I can’t speak for StrongEd, but in Zap you can pick a range of fonts. It isn’t completely intuitive, hidden in the menus something like Display → Mode → Font or the like (I’m writing this on a PC). Given the infamous Zap vs StrongEd holy wars, I’d be quite surprised if you could not also alter how StrongEd looks.
What, in the editor? Depends if the editor supports this. That said, it isn’t too much to press F3 to call up the Save dialogue, and press Enter to save (current filename already supplied).
Ah, I recall that name. Tried a demo. Gave me nightmares. At the time, I wondered if the purpose was to frighten away newbies so the world would not be flooded with really bad scripts. After all, if you could get that working for you, you must be serious, right…? ;-) |
Phil Hanson (2558) 75 posts |
I can’t speak for StrongEd, but in Zap you can pick a range of fonts. I wouldn’t offer a choice at all, no menu for it. That said, it isn’t too much to press F3 to call up the Save dialogue, and press Enter to save (current filename already supplied). I’ve been in customer service for 15+ years. You should always assume user will do something stupid, usually when it will impact them the most. Like zoning out writing a script for an hour but forgetting to save. Besides I want minimal UI in this. (PS: I like how Risc OS has it’s menus in a contextual action.) I wondered if the purpose was to frighten away newbies so the world would not be flooded with really bad scripts. Then it failed miserably, including some I’ve written, heh. |
Steve Pampling (1551) 8170 posts |
Most text editors can – even Edit
The web page looks like people think of typing in Notepad or similar. It’s text with positional information as far as I can see.
Surely the auto-save in Zap would sort that out. It’s not like it’s from another century. Edit: Well that worked – typing a reply in NetSurf on the Beagle-XM upstairs via VNC from the laptop downstairs on a wireless. |
Fred Graute (114) 645 posts |
When it comes to fonts the latest StrongED alphas are pretty on par with Zap.
Assuming the file has already been saved, or was loaded from disc.
I don’t think Zap has auto-save facility. |
Steve Pampling (1551) 8170 posts |
Me neither, but I suggested using StrongED for something it is good at and got a reply from a Zap user suggesting using it for something it isn’t that good at so poking a little fun was a first reaction. It might be interesting for Phil to look at writing a mode file for SE with a script to save into the other format. |
jim lesurf (2082) 1438 posts |
The discussion re Zap/StrongEd in this context reminds me of the old sayings along the lines: Bad workman blames his tools I’m an ‘agnostic’ wrt Zap/StrongEd as I’m a stubborn user of DeskEdit. However it might be that the wisest course for Phil in the long term is, indeed, to see if he can produce a ‘mode’ for Zap/StrongEd that makes it operate in the way he finds good for the tasks he wants to perform. That may then also be useful for others who want to do similar tasks. Mumble years ago when I used PipeDream to write a book – which needed equations and diagrams – I wrote a companion program and modified PipeDream to behave like a technical document processor. Fortunately, later on I and the world were saved by TechWriter. :-) But if no-one else has already done it, then maybe Phil’s itch is best scratched in the above way. :-) Jim |
Steve Pampling (1551) 8170 posts |
I frequently recommend people use what works. At work there is discussion of GUI or command line, my acolytes repeatedly say “try GUI and command line whichever works best is the one to use”
Zap is handier for certain hacky bits but I normally use SE. Overall it just struck me that Phil could, initially, side step the elements for scripting engine, syntax recognition, formatting etc which are already available in SE. If he then wants to move on to a standalone then studying SE will help. |
Steve Drain (222) 1620 posts |
All those would be much peferred for speed and elegance, but there is the RegeEx module available for RISC OS and Basalt uses it to provide BASIC keywords for regex operations. These also work with Basalt’s long strings. |
David Feugey (2125) 2709 posts |
For text editors it’s easy: StrongEd has redraw refresh problems on all my ROS4 computers. |
Steve Pampling (1551) 8170 posts |
StrongEd has redraw refresh problems on all my ROS4 I now there’s something I don’t hit as a problem at all. |
Rick Murray (539) 13840 posts |
It is possible that something changed in a later version? 4.02 is really old. For me, I don’t have any ROLtd version, so if something works on 3.7 and 5.XX then I’ll just assume it’s an RO4/6 issue. As yet, not run into such a problem, although some of my software is RO5 only (uses HAL). David – do you have options you can configure, like screen caching? |
Fred Graute (114) 645 posts |
StrongED should run fine on all machines that run RISC OS 3.5 or above, I’m certainly not aware of any redraw issues on RO4/6. But I don’t test that often on RO4/6 these days as it’s only the old RPC that runs it, all the other machines are running RO5. If you could provide me with details of your set-up then I may be able to reproduce the problem, and hopefully fix it. - version of RISC OS - relevant hardware, eg ViewFinder, VPOD - version of StrongED - type and name of font - when does redraw fail; always, when dragging over |
Phil Hanson (2558) 75 posts |
“Phil” is learning Basic (any language) for the first time. I’m sure a lot of that is beyond me atm. :) |
David Feugey (2125) 2709 posts |
I’m really sorry: I mean, on all my ROS5 computers. Updated I just try to reinstall StrongED 4.69f6, and the bug disappeared (and all my computers). I now suspect something more vicious than a bug. Perhaps I forgot to update my StrongED configuration directory, and something was wrong inside it. Strange. I should try to reinstall my VNC client, and Firefox too :) |
Rick Murray (539) 13840 posts |
Whoa! ;-) |
Fred Graute (114) 645 posts |
Thanks for clearing that up. You had me slightly worried there.
It’s unlikely that an out-of-date configuration caused the redraw glitches. I guess that you had an older release of SE 4.69 installed, these had some bugs in them (mostly ARMv7 issues) that are fixed in StrongED 4.69f6.
Nah, it’s a feature. It’s my bomb-proof, kick-ass way of making sure you never, ever see any crashes when running StrongED. Comes with extended warranty too. |
Phil Hanson (2558) 75 posts |
Well gonna work with StrongED for my lessons today. Time to kick the tires on it, heh. |
Phil Hanson (2558) 75 posts |
So in Basic % is for numbers and $ is for variables? |
Chris Mahoney (1684) 2165 posts |
It’s been a while since I’ve used Basic but IIRC $ is for string variables. |
Phil Hanson (2558) 75 posts |
You know, I meant String lol. |