Add file association to Basic4ppc source code files (on the device)

Erel

B4X founder
Staff member
Licensed User
Longtime User
The attached code adds the required registry entries to associate Basic4ppc source code files (.sbp) with Basic4ppc device IDE.
Run SetFileAssocation from the device IDE.
First it checks if Basic4ppc is installed in the default location:
\Program File\Basic4ppc
If it isn't in the default location, the program will stop and will not change the registry.

* Basic4ppc version 5.80 is required for this application.

You can change the source code to associate other file types.
 

Attachments

  • SetFileAssociation.zip
    7.2 KB · Views: 1,000
Last edited:

agraham

Expert
Licensed User
Longtime User
Basic4ppc version 5.80 is required for this application.
That's strange. :confused: I don't need to do this. Version 5.50 installation didn't associate *.sbp files with B4PPC (and I never associated them manually) but after installing 5.80 they were associated without me doing anything!
 

agraham

Expert
Licensed User
Longtime User
On the device? Including the icon?
:sign0161: Sticks foot in mouth again by reacting without looking carefully! I was referring to the desktop. My device does associate, but not with an icon, so I must have done that myself for the previous versions although I can't remember doing it.
 

Woinowski

Active Member
Licensed User
Longtime User
Before I try it

Does it work on the desktop too, or is the Desktop DLL only a dummy?

(Would like to use it for my own programme)
 

Woinowski

Active Member
Licensed User
Longtime User
Sorry for being lazy...

You should already have the Registry dlls and a help file explaining their use in your libraries folder. Look in the drop down help list.

:signOops: That was too easy, thank you :)
 

burtcom

Member
Licensed User
This is fine and all, but what I'd like to do is click on a .spb file on the device and have it load and execute.

Does Basic4ppc.exe have a flag that will allow this?
 

Cableguy

Expert
Licensed User
Longtime User
The file association does just that...

It replaces the unkonown file type icon on spb files with the b4ppc icon, and when you tap on an spb, b4ppc is automatically launched with this file...
 

burtcom

Member
Licensed User
The file association does just that...

It replaces the unkonown file type icon on spb files with the b4ppc icon, and when you tap on an spb, b4ppc is automatically launched with this file...

Is the file executed, or is it just loaded into the editor?

I recreated the reg values to try this, and clicking on the file loads it into the editor and sits there. I'd like an option or a command-line flag to make it execute the program.
 

Cableguy

Expert
Licensed User
Longtime User
I don't believe that to be possible as it would render a demo version, capable of executing an umcoplied app as if it were compiled...
Not even going to tell you how ofensive that idea is to ALL OF US WHO REALLY BOUGTH THE FULL VERSION, but running code from the editor is NOT as optimized as if it was really compiled as an EXE, nor it is as fast, neither less ressource consuming.
 

burtcom

Member
Licensed User
Let me expand on why I think this is useful...

I'm also a user of PPL, which allows on-device compilation so you can click on your executable on the device and run it.

I really like the ability to program with .net that Basic4PPC provides, but of course compiling is out of the question unless someone comes out with a compiler that runs on the device.

I do most of my work on the device, during commute or when I'm supposed to be watching the kids :) With PPL I can compile my apps and then be able to run them with one click. Then if I find something that needs fixing I can modify the source file then recompile.

I'd like to propose a poor-mans "compilation" for Basic4PPC -- if a source file ends with .spx or maybe .spe, then when the file is loaded it is run automatically, and when the program is quit it also quits the editor.

then if I need to, I can change the extension to spb, edit and test, then change it back to spx when I'm happy. When I get to a Desktop machine I can then compile to get all it's speedy goodness.

This would provide us a one-click option to run our software on the device, and will take PPL down a notch for me :)
 

burtcom

Member
Licensed User
I don't believe that to be possible as it would render a demo version, capable of executing an umcoplied app as if it were compiled...
Not even going to tell you how ofensive that idea is to ALL OF US WHO REALLY BOUGTH THE FULL VERSION, but running code from the editor is NOT as optimized as if it was really compiled as an EXE, nor it is as fast, neither less ressource consuming.

First, I kinda resent your implication. I do not have a demo version, I have bought the full version. I do not propose that this is done to any demo version

Second, for best speed one would want to compile at some point anyway. Having an auto-run will still incur overhead of the editor, but it will provide folks like me who want to do most work on the device a nice shortcut.

Third, PPL, which I also own, allows full compilation ON THE DEVICE :)

Why not give Basic4PPC another edge?

I really like what I've seen so far with Basic4PPC, and I like the ability to program with .net on the device.

Anyway, it seems this is not currently supported, So I'm taking it over to the proposed features thread.
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
First, I kinda resent your implication. I do not have a demo version, I have bought the full version. I do not propose that this is done to any demo version
I'm the first to say " I was mistaken" about you...

Perhaps the way you expressed yourself in the first two postes was not too clear on your intentions...
But now they are clear to me...and I do apollogize.

Second, for best speed one would want to compile at some point anyway. Having an auto-run will still incur overhead of the editor, but it will provide folks like me who want to do most work on the device a nice shortcut.
I can see your point of view....BUT as you posted in a previous post, this would need that one's must change, as you propose, the file extension in order to be executed in 1 TAP...
To run a code file (.spb) NOW you only need 3 TAPs...
TAP on the file...and wait for the editor to came up...
Tap File....
Tap RUN

As oposed to...
Tap and hold the code file...change the extension, and for this you need a third party file manager like total command, as the WM file explorer does not show the extensions...
Rename the file...
Then Tap it again...
You have by now spend twice the time (at least) needed to do the 3 TAPs, not to mention the increasing error possibilities on renaming the File...
Third, PPL, which I also own, allows full compilation ON THE DEVICE :)

Why not give Basic4PPC another edge?

I really like what I've seen so far with Basic4PPC, and I like the ability to program with .net on the device.

Anyway, it seems this is not currently supported, So I'm taking it over to the proposed features thread.

I agree that would be very nice, but not High in the new features requests...
Coding in the device is very usefull to jump-start an app development, but always end up using the desktop for some visaul enhancements....
 

burtcom

Member
Licensed User
I can see your point of view....BUT as you posted in a previous post, this would need that one's must change, as you propose, the file extension in order to be executed in 1 TAP...
To run a code file (.spb) NOW you only need 3 TAPs...
TAP on the file...and wait for the editor to came up...
Tap File....
Tap RUN

As oposed to...
Tap and hold the code file...change the extension, and for this you need a third party file manager like total command, as the WM file explorer does not show the extensions...
Rename the file...
Then Tap it again...
You have by now spend twice the time (at least) needed to do the 3 TAPs, not to mention the increasing error possibilities on renaming the File...

Well, I wouldn't be constantly changing the file extension :) Just when I decide I want to edit it for whatever reason. Most of the time an established app would be started with one click.

Alternatively, one could have a runtime version of basic4pc.exe, perhaps basic4pcro.exe, that .spx could be mapped to -- I believe NS basic has a runtime version that can be used like this.

And as for changing file extension, I have Resco Explorer -- I dare say most of us have some kind of tool for doing this.

Or, the whole thing could be as simple as a checkbox in the editor that, when selected, will auto-run the loaded .source file.
 
Last edited:

bdiscount

Active Member
Licensed User
Compilation

I do ALL dev. on device, testing etc when its all proffed out I go to Desktop and compile an exe. The only improvement on that would be a compiler on the device.
 

taximania

Well-Known Member
Licensed User
Longtime User
When I first started using Basic4ppc, a, 'compile for device' was available on the device.
BUT the exe's would only run if Basic4ppc was installed on the device.

Due to the changes, over the last few years, to Basic4ppc.
'Things', have changed.

I believe a 'compile' from the device would be a bad thing due to software piracy.

I've been asked recently to PM a copy of a DLL to a non paying member.
I declined.

Compile from Desktop or Device gives the hackers 2 chances of giving away, for free, a product that is well suported by Erel, that most users will pay for.

Criticise me if I'm wrong :)

I can take it.
 
Top