kayel
Posts: 109
Joined: Sun May 13, 2012 4:45 am
Location: France

Filetype?

Wed Oct 02, 2013 5:26 pm

This is driving me f***ing mad! I don't know what I've done but all my basic files are now shown in an edit window. They still run but the one I'm working on tells me there's an error on line x. The edit window doesn't show line numbers like the basic window. How do I get back to my basic files opening automatically in the basic window? And why don't they open in a basic window anyway? They're BASIC files for god's sake!

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Filetype?

Wed Oct 02, 2013 6:40 pm

What is the FileType? Try changing it to BASIC (&FFB), if it is not. If you have handled them on a non RISC OS computer chances are that they are showing up as filetype Text (&FFF).
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

kayel
Posts: 109
Joined: Sun May 13, 2012 4:45 am
Location: France

Re: Filetype?

Thu Oct 03, 2013 4:56 am

Good morning DavidS,

I switched the pi on this morning and everything was back to normal.

Yesterday the file type was ffb and the programs without an error still ran ok but everytime I opened one it was in an edit window instead of the basic one that shows the line and column numbers in the bar at the bottom of the screen. I found no way of getting back to the way things were before.
I tried opening a new basic window to copy and paste the code from the edit window to the new basic window but that didn't work because Ctrl C apparently doesn't copy to the clipboard. This came after a couple of days of getting the "Unauthorised Action" message everytime I pressed "Enter" (I found the solution to that on the forum but I can't remember what it was now).
Riscos is exasperating!
So why bother with it?
It's not sluggish like Linux on the pi.
I'm learning the inline assembler and have got stuck in so many infinite loops and had to unplug the pi that I'd rather not think of the time it would have taken Linux to do an "fsck" before telling me I'll have to complete it manually. Windows would have done Hara Kiri.
Riscos just starts up again as if I'd left it properly. Riscos and the pi are SOLID!

Anyway, thanks again and don't go away!

PS I did make a text copy of the basic file I was writing so that I could write comments without Basic keywords being turned into capital letters but I changed it back to a Basic file afterwards. I could even run it up to the first error. That's why I wanted my line numbers back.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Filetype?

Thu Oct 03, 2013 12:44 pm

It sounds like there is an issue with your keyboard under RISC OS. What version of RISC OS are you using? I saw similar problems with RISC OS 5.19 RC8 on the RPi, though these seem to have mostly been fixed in RISC OS 5.21 RC11 for the RPi. Remember that the RPi version has yet to have a stable release version, it takes time to work out all of the problems with new Hardware.

It sounds like RISC OS is not recognizing the key up event after pressing shift. If it starts that again, usualy you just have to reboot. Though I have not seen these problems in RISC OS 5.21 RC11.

As to copying between documents, RISC OS is very consistant about the method for this.
If copying the whole document:
1. menu click (middle mouse button) in the source document.
2. goto save in the menu.
3. drag the save file icon to the destination documents window.

If copying only a selected block:
1. use the mouse to select the block.
2. menu click in the source documents window.
3. go to selection > Save.
4. drag the save file icon to the destination window.

The same basic method will work with almost any application for copying between documents. ^C, ^X, ^V Imediately copy, delete, or move a block of text, with the destination being the current text cursor position.

This is much more consistant than Linux, as different applications in linux use different key combinations, and sometimes different clipboard protocals, while this is the standard way in RISC OS.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

kayel
Posts: 109
Joined: Sun May 13, 2012 4:45 am
Location: France

Re: Filetype?

Thu Oct 03, 2013 4:25 pm

Hi DavidS,

I think you've hit the nail on the head. I'm using Riscos 5.19 RC8.

I have to look at the keyboard to type and from time to time when I look at the screen to check what I've just typed the screen is being filled by lines of the same letter. I thought it was due to sticky keys on my cheap keyboard.

I'm off to the downloads page.

Thanks yet again.

User avatar
Burngate
Posts: 6002
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Filetype?

Thu Oct 03, 2013 4:26 pm

I'm going to guess something completely different.

You've been using !StrongEd (which I loathe but everyone else loves) with all its knobs and whistles to edit your BASIC file.
Somehow RISC OS lost its way and decided to open it in !Edit - which I like and everyone looks at me oddly. And !Edit hides the line numbers.

You can get the line numbers back in !Edit - Menu over the Icon-bar icon and choose the right option.

But it sounds like !StrongEd has recovered itself, so you're ok.

SEDev
Posts: 34
Joined: Thu Aug 02, 2012 10:55 pm

Re: Filetype?

Thu Oct 03, 2013 9:38 pm

kayel wrote:Yesterday the file type was ffb and the programs without an error still ran ok but everytime I opened one it was in an edit window instead of the basic one that shows the line and column numbers in the bar at the bottom of the screen. I found no way of getting back to the way things were before.
It sounds like some other editor claimed the text (fff) filetype. If you could name the applications involved then I should be able to tell you how to get out of it next time it happens.

BTW what do you mean by Basic window? RISC OS doesn't have such a thing. From your description I'd say you're using StrongED.
kayel wrote:I tried opening a new basic window to copy and paste the code from the edit window to the new basic window but that didn't work because Ctrl C apparently doesn't copy to the clipboard.
StrongED uses Ctrl-Shift-C to copy to clipboard and cs-V for paste. If you prefer c-C and c-V then you can alter the key bindings.
kayel wrote:This came after a couple of days of getting the "Unauthorised Action" message everytime I pressed "Enter" (I found the solution to that on the forum but I can't remember what it was now).
You'd have to alter the ModeLock file (Ctrl-Adjust click on the iconbar icon to open it). The latest release, 4.69f3, is a bit more user friendly regarding permissions. It allows you to set the pemission permanently from the error window.
kayel wrote:PS I did make a text copy of the basic file I was writing so that I could write comments without Basic keywords being turned into capital letters but I changed it back to a Basic file afterwards. I could even run it up to the first error. That's why I wanted my line numbers back.
You seem to be using Basic mode to write assembler. Basic mode doesn't know about assembler comments so the line is passed to the KeyWordFix tool which ensures that all keywords are in capitals.

There are two ways to fix this. Either change the functions tied to the Enter key or use BasAsm mode which does know about assembler comments.

kayel
Posts: 109
Joined: Sun May 13, 2012 4:45 am
Location: France

Re: Filetype?

Fri Oct 04, 2013 5:36 am

Hi Burngate,

I just found out where my drafts go, or rather, why (unsolved question from an old post). I take too long to reply and get logged out, then when I try to send my message I have to log in again and my draft disappears. I didn't think I had to save my message as I was writing it. Anyway, one mystery solved.

Hi SEDev,

You're both right, I use StrongED. What I called a BASIC window was a window you get by clicking on the StrongED icon on the icon bar, then CREATE, then BASIC. In the light of what you say about comments I'll be using BasAsm from now on.

One of the reasons I temporarily convert BASIC files to TEXT files is so that I can write comments without a knob or whistle changing any words that just happen to be BASIC keywords into uppercase. Sometimes knobs and whistles get in the way.

I have a vague idea of what confused me (and perhaps, Riscos):

Another reason I change BASIC files to TEXT files is so that I can print them from my laptop.
Sometimes I fiddle with them on the laptop too, using GEDIT and save them back to a USB key.
If I find anything usefull to read, that goes onto the USB key as well.

I don't think I've EVER used !Edit on purpose but the !Edit icon was on the icon bar so Riscos must have used it to open one of the files.

I've just created a file using !Edit and checked its filetype: fff
I had a look at a BASIC file that I had changed to a TEXT file: filetype fff
Both icons are identical (the blue pencil on a white sheet of paper with writing on it).

So how does Riscos know which program to use to open the files?

I had several windows open at the time things started going haywire so that probably added to the confusion.

I've just installed the latest version of Riscos because there certainly was a problem with the keyboard.

Thanks again everyone.

SEDev
Posts: 34
Joined: Thu Aug 02, 2012 10:55 pm

Re: Filetype?

Fri Oct 04, 2013 1:40 pm

kayel wrote:One of the reasons I temporarily convert BASIC files to TEXT files is so that I can write comments without a knob or whistle changing any words that just happen to be BASIC keywords into uppercase. Sometimes knobs and whistles get in the way.
There are better ways to do this (apart from using BasAsm mode). :-)

In StrongED hit cs-Esc to switch to BaseMode and enter your comments there. When done hit cs-Esc again to return to the previous mode.

You may also want to try c-Enter in BASIC mode and see if that is of any use.
kayel wrote:So how does Riscos know which program to use to open the files?
When you double-click a file RISC OS will first send a DataOpen message to all running applications. If an application can handle the filetype then it should claim the message and open the file.

If no application claims the message then RISC OS will look at the system variable Alias$@RunType_xxx (where xxx is the filetype). If the variable is set then it will execute the commands tied to it. This usually results in an application being started which then opens the file.

The system variables for the various filetypes are set by applications when they are booted, usually when you open the directory they live in. Properly behaved applications will only set a variable when it isn't set already. Setting a RunType variable when it's already set changes the application that will open files with that filetype.

If you alter the filetype manually then that may cause problems. Changing BASIC files to text files means they will no longer be run when double-clicked. Instead they will be opened in a text editor, where they will look strange as the file is still tokenised BASIC. In StrongED BASIC files with the correct filetype are detokenised on loading and retokenised on saving.

Hope that helps.

kayel
Posts: 109
Joined: Sun May 13, 2012 4:45 am
Location: France

Re: Filetype?

Fri Oct 04, 2013 7:05 pm

Hello again,

So if there are two applications capable of running the same file-type it's the first one polled that claims it and you can click on files until you're blue in the face , it will always be the same application that opens them until you shut down.
That's what happened.

One thing intrigues me: how did DavidS know I was having keyboard problems with the poor amount of information I gave him?

Thanks again to everyone. This post has turned into a veritable tutorial.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Filetype?

Fri Oct 04, 2013 11:55 pm

kayel wrote:Hello again,

So if there are two applications capable of running the same file-type it's the first one polled that claims it and you can click on files until you're blue in the face , it will always be the same application that opens them until you shut down.
That's what happened.
No it can be changed. For example if your text editor is to !StrongEd, and and you open a file with !SrcEdit while StrongEd is not running it is likely that the default application for Text files will be !SrcEdit until you do something similar to change it again, or you reboot.
One thing intrigues me: how did DavidS know I was having keyboard problems with the poor amount of information I gave him?
It worked out well as I misunderstood part of what you said, thinking that a text editor was opening the file when you wanted to run it. That would be a symptom of the system thinking that the Shift key was staying pressed.
Thanks again to everyone. This post has turned into a veritable tutorial.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Return to “RISCOS”