Hello all
Phil Hanson (2558) 75 posts |
These all sound like good idea, but I can’t get wifi to work from my dongle. So you’re saying to do anything with Risc OS itself, Basic isn’t the way to go? |
Dave Higton (1515) 3526 posts |
Everyone has their views on what are good and bad languages. I write most of my applications for RISC OS in BASIC, including the GUI. It certainly can be done. I think it’s easy, although that may be a product of years of familiarity. You have to to try something and see if you can get on with it. Then (preferably after you’ve succeeded with the first), try something else. |
Richard Walker (2090) 431 posts |
A long while ago, I thought C (with the help of OSLib and the Toolbox) was pretty reasonable. Worked with GCC or the ROOL DDE. But if you have never coded anything, step one is probably a tutorial on the basics of ANSI C. |
Rick Murray (539) 13840 posts |
The problem with BASIC is that the OS API requires a lot of data pushed into a lot of data structures, something BASIC isn’t so good at. Consider this. It isn’t my code, it’s an ancient biorhythm plotter, that is one of the few things I have on this machine that isn’t compressed, squeezed, squished, or otherwise messed with.
Or this:
Or, finally…
You can write perfectly serviceable programs in BASIC. It’s just, you’ll need to be quite familiar with the API, or depend heavily on a good library to hide away all the nasty bits.
I started programming (as a child) BBS BASIC on a Beeb, along with 6502 code for when stuff needed to happen in a way that BASIC wasn’t so good with. For you, I won’t recommend a language. Instead I’ll ask you this: What do you want to write? |
Phil Hanson (2558) 75 posts |
I just want to write things that work that I can understand at first. Even Basic is confusing me a bit atm. |
Phil Hanson (2558) 75 posts |
Since I can’t connect to the Internet, how do I save a file from Risc to a USB that I can read. I tried doing it but get a bunch of weird characters. Doesn’t seem like I can copy and paste the code into another Edit doc either for some reason. |
Chris Johnson (125) 825 posts |
What editor are you using? Traditionally, RISC OS editors behave differently as far as cut, copy, paste from other OSs. By default most editors will use the ‘Acorn’ model for copy, paste etc. It is usually possible to select text in one editor window, put the cursor in the other window and simply use ctrl-C. The text is copied. To cut and paste, do the same but use ctrl-V instead. The text is moved from one document to the other. Editors such as Zap or StrongEd can be set up to use the alternative model of other OSs, or they can use an alternative keypress combination.
Do you mean a usb memory stick or card, or do you mean an actual usb drive? Assuming the former, there are two ways. 1) format the stick to filecore adfs – this is the RISC OS native format and can only be read/written by RISC OS. 2) Install Fat32Fs, and this will probably be able to read/write the stick as is. If not, there is a Fat32format(ter) for RISC OS. Using Fat32 format the stick can be used on RISC OS, Windows etc. |
Phil Hanson (2558) 75 posts |
I’m using Edit in Basic mode. If I use Menu and select Copy, it copies AND pastes into the same window immediately. Control C does the same thing. I tried just selecting text in the Basic Edit window going to a text Edit window and ControlC and V, nadda. I really want to learn the native RiscOS way. It’s a Kingston 8 gig flash drive. I can see the drive on both PC and the Pi. I see it on the Pi as a Fat partition. I can read and write in both OS, just when I take the Basic file over to PC and try to open in Notepad, it’s a bunch of (Chinese) characters. When I but the words test in a .txt file and open it in RiscOS, it reads it just fine. I know that Risc has this Hex file format and I can see the Basic file is in “Basic” not text, which is cool if I could only get it into a text file to send back to PC, so I can post it here in forums, heh. |
Steve Drain (222) 1620 posts |
And that is a major limitation of adding features to BASIC itself, albeit one of such vintage. On the other hand, it is not at all difficult to write routines with local memory that do not use DIM LOCAL, or indeed the Basalt equivalent of DIM … LOCAL, which can be used with all flavours of BASIC.
That is all very true, but:
The evidence is in the thousands of successful applications that have been written with BASIC over the years.
And there is the solution. If you do not want to learn th API in detail, use a library. Although there have been dozens in the past, I suppose that means using Dr Wimp today. You also need to take into account the abstraction offered by the Toolbox, although that is still a big step from drawing circles in single-tasking. For that you might well use the AppBasic library. And then there is Basalt. ;-) |
Rick Murray (539) 13840 posts |
RISC OS never really developed with the idea of a “clipboard” in mind. Applications sort of do something similar, but as you have noticed, ^C to copy takes immediate effect (so you select, reposition the cursor in the same document, then Copy) and likewise for ^V to move. There is a Global Clipboard system written by others, but I found support for it was extremely varied so eventually I just didn’t bother. The proper RISC OS way to copy stuff between documents in different programs? In the destination program, position the cursor where you want the text to be inserted (not always necessary, depends upon the program). In the source program, click-drag to select the text to be copied. Open the menu. Go to “Selection” then “Save” and just drag the file from there in the the destination program. That’s the RISC OS way and is used all over the place. You can drag diagrams directly from Draw into a desktop publisher, you can drag images from Paint into a word processor that supports pictures (EasiWord?). The only limitation is whether or not the recipient can deal with the file being given; you can’t drag an executable into a desktop publisher, what’s it supposed to do? You can drag an executable into Edit and it will display the contents of the file – a lot of gibberish. Zap is better, it’ll show you a disassembly. Anyway, that’s the secret. Drag-save a selection. |
Rick Murray (539) 13840 posts |
One might even say that, to a degree, BASIC programs are something that saved RISC OS. You see, compiled software compiles using the technology of that day. You know this, Steve, I’m pointing it out for others… So back when RISC OS was young, the processor’s Program Counter and Status Register were combined (and the ARM was incapable of addressing more than 64MiB of memory, which was a huge amount when a 4MiB machine cost thousands (And 4MiB was the most a single memory controller could deal with)). BASIC programs with no embedded assembler? Let’s put it like this. A multitasking application written in pure BASIC for RISC OS 2 will work perfectly well today. Some things will be suboptimal (like it’ll receive all Wimp messages and icon sizes might be a little off for outline fonts) but it will work. I know, I wrote some, I still use them. BASIC is interpreted and slow, but BASIC is BASIC. I’m probably the only person in the world that quite liked 1stWord+. It offered a lot for basic text formatting without trying to be something special. Well, it is a long forgotten relic, sources long lost. Arcade BBS runs on a StrongARM RiscPC and it would be quite easy to transition a BBS server to a telnet-only setup running on a RaspberryPi. But… Hugo has moved on a long way since 1995 and the sources? Who knows… So there’s two things lost to changes in architecture and the ravages of time. I’m sure everybody here can list a favourite app that I’d no longer… Your choice. ;-) |
jim lesurf (2082) 1438 posts |
I did find BBC BASIV very very useful for many years. IMHO Its fine for many people for many purposes. However it probably contributed to my struggling with being able to write RO WIMP programs. OTOH I soon found that I liked ‘C’ as a sort of ‘high level assembler’. :-) BTW IEEE Spectrum did an analysis of the most ‘popular’ and ‘in demand’ languages a while ago. Java came top, just above ‘C’, which was just above ‘C++’. Python came 5th. My old friend FORTRAN came 24th. Lua came 25th. ;→ Alas, no mention of BBC BASIC. Visual BASIC (sigh) came 14th. If someone wants to make a career in computer programming that probably matters in terms of the ‘language skills’ some companies expect. Although I’d agree that a good programmer can learn to use whatever language is required. Jim |
jim lesurf (2082) 1438 posts |
I liked View. Which is why I ended up writing my first book using PipeDream. 8-] And I still like PipeDream even though I now use TechWriter for writing documents. Jim |
Rick Murray (539) 13840 posts |
It was very popular for a while. Aren’t Android apps written in a sort-of-Java ?
Doesn’t have the critical mass. I think even in the heyday of Acorn, there are likely to have been less BBC BASIC coders then than there are Java/app coders now.
Visual Basic isn’t bad to getting a job done simply. The problem is a lot of mediocre coders flocked to VB (as it hides all the nasty complicated bits) and wrote software that was varying degrees of abysmal. I guess that’s the penalty one has when somebody tries to make programming “easier”. |
Fred Graute (114) 645 posts |
@Phil
You’ll need to save the file in text format. Click Menu over the Edit window and use @Rick
Yes, originally RISC OS used a direct copy model and most applications still do. Some applications, such as Zap and StrongED, support both direct copy and the Global Clipboard. As Chris J. has already pointed both have configurable key bindings so you can set things up to your own preference.
Adding support for the Global Clipboard isn’t that hard. If your application already implements enough of the DTP (Data Transfer Protocol) then it’s just a matter of adding some message handling (it’s just the DTP with a different initial message). If your application implements very little of the DTP, or if it’s hidden away (Toolbox), then the Clipboard module can be used. In the simplest case it takes only one line of code to pass the data to the module, which will then handle all the messaging.
It would be even better if you could drag the selection directly without having to open a save box. But support for the Drag-and-Drop system is even thinner on the ground than support for the Global Clipboard protocol. StrongED is one of the very few applications that support it.
As does StrongED. Both Zap and StrongED are much better at this (and many more things) than Edit and anyone still using Edit is strongly recommended to give them a try.
Except that this doesn’t work in the case of BASIC files and Zap, it will produce gibberish and crash Edit as Zap doesn’t bother to convert the selection from its internal representation into proper BASIC. You need to save it to the Filer first then drop the file on Edit. (I know cos I’ve made lots of changes to StrongED’s BASIC handling lately including much testing with Edit & Zap.) |
Steve Drain (222) 1620 posts |
But for the vast amount of time desktop applications are waiting for user input – so speed is not important. With the processor speed of later machines there are fewer areas where program speed is vital from the user’s point of view – fast enough is the same as fast. That still does not make BASIC a good choice necessarily, but I do not buy the interpreted speed argument alone. |
Rick Murray (539) 13840 posts |
That’s why I countered with pointing out that assembler, while loads faster, has “needed fixing” twice so far… Pluses and minuses. |
Steve Pampling (1551) 8170 posts |
Twice? Armv3 —>StrongARM changes (and bugs) |
Rick Murray (539) 13840 posts |
I wasn’t bitten by that one, but yup – you’re right. So that’s three times. ;-) |
Phil Hanson (2558) 75 posts |
Thanks for the input. I’ve been doing all my Basic learning in !Edit so far. Saving, then running the saved file. |
Steve Pampling (1551) 8170 posts |
Everything I’ve done in programming1 terms is in BASIC2 so no bites.
Of course :)
At least three3 by my count
|
Phil Hanson (2558) 75 posts |
Please delete this reply. |
Phil Hanson (2558) 75 posts |
For you, I won’t recommend a language. Instead I’ll ask you this: What do you want to write? First thing would be a lightweight version of this: |
Rick Murray (539) 13840 posts |
Interesting project. Many years ago, I wrote my own screenplay markup (called Scripter). It had a DOS text renderer and could build OvationPro files1 (and an early version also generated 1stWord+ files2 for easy printing through RISC OS). There was nothing freely available at the time so I made my own. The file layout and style is my own as well (probably not industry standard by any means) but what is? Of the demos I saw back then, all four packages generated completely different looking output. Hmmm… I don’t remember if it is mentioned in the user guide, but my OvHTML software (HTML to OvationPro – very dated!) supports the Scripter markup. 1 Fonts, justification, nice to look at. 2 This one was based upon the style of the Buffy Shooting Scripts book. |
Phil Hanson (2558) 75 posts |
Well getting the plain-text markdown to format in a script correctly would be step one. Ideally I’d want this as a two window app (Unconnected) where one app allows text input and the other displays in real time the output of the formatting. I have tons of other ideas too but this is the base. Unrelated: Can we change the timeout of this forum? I like to lurk and after I type something out, it asks me to log in. |