Application structure program
Nicholas Kingsley (2769) 31 posts |
Is there an application that will automatically create a valid program directory structure (complete with !Run, Boot etc)? |
GavinWraith (26) 1532 posts |
AppBasic does this. Click Select on !AppBasic’s iconbar icon and then on the trowel-and-bricks icon that hangs off the left of the AppBasic window. Then you drag the !BasicApp icon to where you want your new application to be, possibly editing its name first. There have been many applications that do this sort of thing. The programmer is free to define the internal structure of an application pretty much as she wants. RISC OS itself makes few demands. AppBasic, for example, uses an Obeyfile called Modules for isolating all the RMEnsuring of toolbox modules – a good idea. An application does not have to have a file called !RunImage. !Run could cause something else to run. In which case I believe it is a good idea to have a blank file called !RunImage. I have forgotten why; no doubt it keeps the filer happy. The names, but not necessarily the presence, of the files !Boot, !Run, !Sprites and !Help are mandated. Stick uses !Select, !Adjust and !Drag. I sometimes use !Launch when an application needs another Obeyfile like !Run. We are in a twilit territory that lies between tradition and protocol. Such places are often found in the computing world. |
Rick Murray (539) 13404 posts |
Cargo cult? I’m not aware of anything specifically requiring !RunImage – indeed when I program in BASIC the !Run points to SourceCode and the RunImage doesn’t turn up until the finished crunched program is built. One thing though that many people miss. The help file within the application should be !Help and not !ReadMe. Then it’ll show up as a Help entry in the filer for that application. |
GavinWraith (26) 1532 posts |
I have remembered why. Try this experiment. Make an application directory !X. Put a !Help file inside. Open the filer submenu App. !X. The Help option is still greyed out. Now put a blank !RunImage file inside !X. Try again with the filer’s App. !X submenu. Bingo, the Help option is there. You know the story about the professor who claimed that frogs hear with their feet. When I tell the frog jump he jumps. I remove the feet. When I tell him again, he stays where he is. Proof! |
Jan-Jaap van der Geer (123) 61 posts |
Also, the modification date/time of an application, as shown by the Filer, is the date/time of the !RunImage file, not from the directory itself. |
Steve Drain (222) 1620 posts |
Basalt has a minimal application, A directory is only an application1 if it has a Edit: Jan-Jaap got in before me. ;-) 1 Which is why the plain !X directory does not show a Help entry. |
Chris Hall (132) 3502 posts |
The !RunImage file is optional. I always name my ‘runimage’ file with a name appropriate to the application, with an identical file with the version number as a suffix to the filename. |
GavinWraith (26) 1532 posts |
Thanks to both. At the back of my mind was the idea that it had something to do with datestamps. I knew there was a reason why I put blank !RunImage files inside the tools in the RiscLua distribution. |
Rick Murray (539) 13404 posts |
Hmm, while I can see a potential purpose for datestamping the application as the date of RunImage (though I disagree), the implementation of Help should depend upon the presence of the Help file alone. RISC OS specifies that a directory beginning ! is an application, so shouldn’t need to check for other potentially arbitrary things. |
Nicholas Kingsley (2769) 31 posts |
Thanks for that – its for the test programs of my Triority system – at the moment, I’m duplicating previous directories (and their contents) and then modifying the compiling filenames, obey and source codes… |
Steve Drain (222) 1620 posts |
OK, “essential” was a bit strong, but if an application directory is to be treated as a whole, then the only way it can be dated1 in the Filer is by the existence of a Perhaps it is worth noting that an image file can be an application if it complies with the neccesary conditions, and it is dated from its
Why? The Help item in the menu is only intended for applications. Why would you need/expect one for an ordinary directory? NB ‘Help file’ changed to ‘!Help file’. ;-)
Does it? It specifies that an application directory must begin with ‘!’, but not that all directories begining with ‘!’ have to be applications. Here’s another quirk for you to ponder. Create a directory without an initial ‘!’, include a
I suspect that that was the way a great number of us first discovered how to write applictions. ;-) 1 I have avoided using ‘stamped’, because outside the Filer I think things revert to what you would expect. |
Rick Murray (539) 13404 posts |
I try to avoid using too many !s because Textile is braindead. $.RunImage…1 ☺ 1 Original is “ |
Steve Drain (222) 1620 posts |
Very true, but this morning you typed:
C’mon now, Rick, which is it? ;-) |
Rick Murray (539) 13404 posts |
I’m surprised Textile didn’t mess that up. However… …morning… …that time in between leaving standby state and cerebral tea percolation. Don’t expect anything from me to make any sense at all until I’ve had three mugs of Tetley. ;-) |