Can I access to another project Main directly from another Main?

limhyeam

Member
Hi,

I am new to this basic4ppc. I was using basic4ppc to create several standalone sbp files, and currently I am currently creating a main control to call these separate sbp files. However, I could not find a something command like in C, #include "*.sbp" to access to the other file.

I believe the only way is to create dll files to do that, am I right? If so, how can I convert all my sbp files into dll files? Please advise.

Thanks.
 

derez

Expert
Licensed User
Longtime User
Your need is defined in B4PPC as Modules.

Read about Modules in the help and you'll see how to combine all the parts to one program.
 

limhyeam

Member
As far as I understand from the Modules section in B4PPC, I can create as many .bas files, but, I can only have one .sbp file.

However, I was thinking whether can B4PPC access/execute other .sbp file from one .sbp file. I know that the .bas files can be accessed by any .sbp files.

The reason why I am doing so is that, my project is a huge one, and each of the modules I am about to create are independent to one another and I need a main controller (another project file) to control that. I know it is very confusing, but, anyway, I just would like to understand that whether does B4PPC allows me to access other .sbp files from a .sbp file??

Thanks.
 

mjcoon

Well-Known Member
Licensed User
If your components are independent then presumably the data to be passed is minimal or zero. With synchronisation? So you could compile each to separate .EXE files and call them as one program from another? (This could apply whether they were B4PPC .sbp in origin or any other language.)

Mike.
 

limhyeam

Member
Thanks Mike for your reply.

I was thinking of changing to .exe and call from the .sbp using the shell(). However, there could be a problem which is the passing of the control from one exe to another, if I were to design in that way using one .sbp to control all other .sbp.

Actually, I am trying to explore the other possibility of this B4PPC, whether I can actually do that in the code. In VB, they allow you to make a separate program to become .ocx control and u can use that control in the project. I was thinking somewhere in that line with B4PPC. Just wonder whether this is possible for B4PPC?

Thanks again. :sign0089:
 

agraham

Expert
Licensed User
Longtime User
In VB, they allow you to make a separate program to become .ocx control and u can use that control in the project.
That's not much different (in principle though the mechanism is different) to isolating separate blocks of codes in Basic4ppc modules. In both cases all the code is resident in memory at run time so you gain nothing by using a separately compiled control/program and anyway on the desktop nowadays memory use should be of little concern for most practical Basic4ppc applications.
 

limhyeam

Member
You are absolutely right about the memory. My idea is more of modularizing each functionality of the program in terms of standalone project, so that it is like a library of objects/controls that you can actually changed without having to touch the actual function itself.

For easy illustration, we can have a form control/objects in it, but, we cannot change/add/delete the object at our own wish, because it is "controlled". If we write a module .bas and share among the other projects as module, tendency is that people can change the module and broke our code easily. By the way, is there anyway we can block user from changing the module?

Hence, building the module into a standalone project, we can control better in terms that way. Am I right to say that?

Thanks. :sign0089:
 

agraham

Expert
Licensed User
Longtime User
By the way, is there anyway we can block user from changing the module?
I'm not sure what you mean by "user" as my interpretation is that a "user" would not be involved in writing code at all

I don't understand the situation where you want to share source code but don't want the programmers to be able to alter it. If you let people use your code and if they did customise it to a particular situation why would it matter anyway as long as you didn't fold it back into the main development line?

If you are are looking at a collaborative programming environment with controlled access to source code then Basic4ppc is not really an appropriate product although I guess you could use some sort of version control system with it.
 

limhyeam

Member
Thanks for your prompt reply, Agraham.

Sorry, I think I meant the programmers (user of my modules) and not the end user of the product.

Sorry, I think my explanation is a bit blurry. Well, when I was sharing my application, I was thinking of not sharing the full source code, but, only the objects of the application. Meaning, I have a form layout in a certain way that I dont wish the other programmer to alter my layout or change the functionality of that forms to what he/she wants. The programmer can call my forms from his/her program using some kind of control.

Cheers :sign0089:
 

Zenerdiode

Active Member
Licensed User
However, I was thinking whether can B4PPC access/execute other .sbp file from one .sbp file. I know that the .bas files can be accessed by any .sbp files.

No, B4PPC can not access or execute other .sbp files. Nor can it access and execute .bas files at runtime either. During design time, .bas files can be accessed from any .sbp file. But I think the point that you are missing is that the .bas files or modules that they come from; are combined into the one executable during compilation. Once compiled, you do not distribute the .bas files with your executable.

Think of modules and the .bas files they produce, as an enhanced way of segregating code; and re-using code in other projects at design time only.

If you want others to write .bas modules for you, provide a stripped out .sbp file with the minimum controls for them to get the module working.

If you would like end users to be able to write a little bit of code to customise, Agraham has written a Scripting Library for B4PPC and has a syntax almost identical to B4PPC. However, it is only available to Registered/Licensed B4PPC users.
 

limhyeam

Member
Thanks a lot Zenerdiode for your reply. I understand now.

Quote: Agraham has written a Scripting Library for B4PPC and has a syntax almost identical to B4PPC. However, it is only available to Registered/Licensed B4PPC users.

Can you provide me the location where I can find this Scripting Library?? Thanks. :sign0089:
 

agraham

Expert
Licensed User
Longtime User
Last edited:

limhyeam

Member
Actually, I used this username to investigate some of the items. I have already purchased a license under a different username. This username is meant for the forum. Anyway, if you were to publish it here, I can use my other username to download it. Hence, should not be a big problem for me.
:sign0089:
 

tsdt

Active Member
Licensed User
This account is registered under my other account.

I was actually trying to explore the flexibility and easiness of programming in this language, so that in future, we can purchase the enterprise version or more license for the software engineers to use, only if the language can actually cater for our needs.

I hope that you can clear the issue I had over here. Thanks
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…