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

  • Good Essays

    Generally, you shouldn 't use any names that are the same as the functions, statements, and…

    • 878 Words
    • 4 Pages
    Good Essays
  • 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
  • Good Essays

    3. Parses command-line arguments. If no command-line arguments were provided, the Sysprep window appears that enables users to specify Sysprep actions. 4. Processes Sysprep actions, calls appropriate .dll files and executable files, and adds actions to the log file. 5. Verifies that all .dll files have processed all of their tasks, and then either shuts down or restarts the system.…

    • 2287 Words
    • 10 Pages
    Good 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
  • 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
  • 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
  • Good Essays

    This infamous short story by renowned writer, Edgar Allan Poe, contains many dramatic twists and turns while brutally describing the murderous events that took place at a marvelous masquerade ball. As the story begins Poe walks the reader through each of the rooms in the house. When he describes that sound made by the clock it shows that there is a nervousness in the crowd of people. Later on in the party this happens again but instead of just a single daunting ring there were twelve, which brought fear to the guests. Once the last bell had sounded, a mysterious masked figure appeared and took everyone by surprise.…

    • 623 Words
    • 3 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
  • 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
  • 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

Related Topics