Preview

Exploring How to Call External Programs or Functions from a Program

Satisfactory Essays
Open Document
Open Document
258 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Exploring How to Call External Programs or Functions from a Program
Exploring How to Call External Programs or Functions from a Program
A function is a module that returns a value back to the part of the program that called it. A function is a group of statements that perform a specific task. When you execute a function, you call it. To call a function in VB you would use something like “Function generateRandom(pingCounter As Integer) As Integer” to start the function. You would then insert the rest of the code that you need and then end the function with the “End Function” command.
To call an external program I found this information and code (at http://en.wikibooks.org/wiki/Visual_Basic/External_Processes):
The simplest way of running an external program is to do something like this:
Shell "cmd /c dir %temp%"
Shell is a built in Visual Basic function that executes a command line and returns a handle to that process. Shell takes an optional argument that controls the window style of the new process (maximized, normal, hidden, etc.).

A couple of other codes found at http://www.canaimasoft.com/f90vb/onlinemanuals/usermanual/TH_45.htm:
To declare a DLL procedure, you add a Declare statement to the declarations section of the code window. If the procedure returns a value, write the declare as a function:
Declare Function publicname Lib "libname" [Alias "alias"] [([[ByVal] variable [As type] [,[ByVal] variable [As type]]...])] As Type

If a procedure does not return a value, write the declare as a Sub:
Declare Sub publicname Lib "libname" [Alias "alias"] [([[ByVal] variable [As type] [,[ByVal] variable [As type]]...])]

You May Also Find These Documents Helpful

  • Satisfactory Essays

    You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name.…

    • 368 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    It is made up of a group of libraries running as a layer on top of the operating system which programmers can call on to add functionality to the program they are writing. It uses applications such as printing, mouse clicks, data saving, copy, paste and many more. The main advantage of these libraries are that they are already written, debugged and backwards compatible with older versions of programs using the .NET framework.…

    • 1025 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Unit 4 Homework

    • 401 Words
    • 2 Pages

    Not Sure what is going to happen because I wrote that whole program and nothing happen. The Value is passed into the parameter value on this program module though.…

    • 401 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    2) Examine the following pseudocode module header, and then write a statement that calls the module, passing 12 as an argument.…

    • 1580 Words
    • 11 Pages
    Better Essays
  • Satisfactory Essays

    Flvs Spanish Work

    • 281 Words
    • 2 Pages

    Biblioteca = library|Remember to use ESTAR as your verb, just as it is used as the verb in the question. Use…

    • 281 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    A shell is a type of command prompt, it sends commands from the user to the kernel…

    • 392 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    One uses a decimal place and also one is command prompt the other is gui interface.…

    • 435 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    It-250 Week 5 Questions

    • 397 Words
    • 2 Pages

    Libraries USE names such as libxxx.a or libxxx.so. When linked on the command line with a library, strip the lib prefix and .a or .so suffix; then prefix the remaining name with –l, as in –lxxx. By default gcc searches the /usr/lib directory for libraries. When you specify –Lpathname on the command line, gcc searches the pathname directory for each instance of –L.…

    • 397 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Note: All captures must be text only—DO NOT capture the NotePad++ application window or the command prompt window. Use copy and paste of text only.…

    • 1575 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    My first step is rewriting the expression getting rid of parentheses. I start with my original expression which is,…

    • 481 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Attribute grammar

    • 591 Words
    • 3 Pages

    You can use only synthesized attributes in the parser by building syntax trees there, and passing those syntax trees to semantic processing routines. The semantic processing is free to make many passes over the syntax trees, even though the parser makes only one bottom-to-top traversal of the parse tree.…

    • 591 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    The Chieftest Mourner

    • 1055 Words
    • 5 Pages

    1. VB and VB.NET are very similar. They have their roots in BASIC, a programming language used on nearly every architecture since the language's inception. Even the classic Commodores used it. Of course, VisualBasic is a long way from the Beginners All-purpose Symbolic Instruction Code used on the Commodores and the Apple ][. Over the years, things were added to the language to allow it to perform different additional functions. Before Windows, Microsoft released a version of BASIC with MS-DOS called QBASIC. This was the direct predecessor of Visual Basic, introduced to make programming Windows applications simpler, much as QBASIC was introduced to simplify DOS programming. VB quickly grew and matured, expanding functionality with every edition until it became equally as powerful as nearly any other language available. VB.NET took VB and hooked it even further into the rest of the system by connecting the language directly into the brand-new .NET framework. The only real difference between the two is built-in .NET support, though VB.NET does streamline the way some things are done.…

    • 1055 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    This design is based on the rule that all macro definitions should appear at the beginning of the program.…

    • 488 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Sap Smart Forms

    • 2696 Words
    • 18 Pages

    This function module interacts with the application program and print program to create the output…

    • 2696 Words
    • 18 Pages
    Satisfactory Essays
  • Good Essays

    Sybex Inc (1999) stated that visual basic provide a graphical environment in which the users usually designed the forms and control that become the building block of tour application . Visual Basic support many useful tools that will help the user more productivity.…

    • 741 Words
    • 3 Pages
    Good Essays

Related Topics