Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

How to create program in C++ using Dev-C++

How to create program in C++ using Dev-C++

01. Create a new folder in "My Documents" to save your programs.



02. Name that folder. For example, "My C++ Programs" or whatever you like.



03. Start Dev-C++.


 
04. Click on file ->new->Source File.



05. Click on file -> Save As.


 
06. Select the destination to save your file.



07. Give the file name and save it on the folder that you created for it.



08. Type your source code.



09. To compile and run both with single key press F9.




10. If you type your source code properly, your program will execute, otherwise it will show error.

11. If your program shows error, then see your source code carefully, identify the errors and correct it.

12. After correcting your source code, you to have compile and run it again. Press F9 again to compile and run.

Modules and Run/Liberty BASIC

People have been asking for a way to create code libraries in Liberty BASIC for some time. I have thinking about how to do this using an in-memory model. Over the weekend Scott and I worked on adding some modularity to the Run/Liberty BASIC language. Here's how it works so far. We are open to suggestions.

The RUN statement has a new form. If I want to use mymodule.bas as a module in a program I am writing I would code it like this:

run "mymodule.bas", #myModule

This causes mymodule.bas to be compiled into memory. It will execute code up to the first wait statement. This is how values will be initialized. The program then becomes an object assigned to the #myModule handle.

Then you can call any function on that program from within the calling program, like so:

#myModule myFunction(myParameter)

or even use the invokation in a more complex expression:

print "digits: "; len(#myModule myFunction(myParameter))

You may recognize this syntax as being the same as for controlling widgets. It relies on the same underlying mechanisms to do its work.

When we're done with this, modular programs loaded this way will be cached in memory and will only recompile when the source file changes.

Check out this stream