Skip to main content

Questions tagged [subroutine]

A subroutine (e.g. procedure or subprogram) is a portion of code within a larger program, which performs a specific task and can be relatively independent of the remaining code. The syntax of many programming languages includes support for creating self contained subroutines, and for calling and returning from them. They are in many ways similar to functions, but usually have side-effects outside of the simple "return value" that functions return.

Filter by
Sorted by
Tagged with
1 vote
1 answer
97 views

How to break my code into subroutines? - Java

I have written a code for data management and parallel arrays but it has to be broken into methods/subroutines. Whenever I try to do so, some aspect of my code stops working. Would it be possible for ...
galaxies's user avatar
1 vote
1 answer
45 views

Populates Data from one Workbook to Another

Another code clean up I am working on. I have been breaking up my code based on things I have learned here on CR. The code below all works and functions as expected, but I know it can be streamlined ...
Zack E's user avatar
  • 535
2 votes
3 answers
104 views

Using buttons to trigger a Sub Procedure in Excel, this will split/copy data into a second sheet in the same workbook

I currently have an Excel workbook which pulls data from a website that lists sign language interpreters from here. There are 7 different regions, or tables, I pull from. The data is put into Sheet1, ...
C.Nug's user avatar
  • 23
2 votes
2 answers
51 views

Resolve dependencies from output of PBS queueing system

I have written a script, that reformats the output of qstat -f1 of the PBS queueing system. Unfortunately this project is by far too big to post here complete, also ...
Martin - マーチン's user avatar
2 votes
1 answer
43 views

Read group of keywords from file, modify value, store new group to variable

I would like to use the following routine in my submission script for GAMESS calculations. I am not entirely sure if this is the optimum way to go. This function would need one of the messaging ...
Martin - マーチン's user avatar
4 votes
1 answer
79 views

Checking if input file exists, assign output file destination, prevent overwriting any files

I would like to use the following routines in my submission script for GAMESS calculations. Before I do, I would like to get some input if I can improve it somehow. The three messaging routines (<...
Martin - マーチン's user avatar
5 votes
2 answers
1k views

List all repeated substrings with a fixed length

While fiddling around, I've made a very simple and naive function to retrieve any repeated sub-string within a certain string. ...
Ismael Miguel's user avatar
2 votes
1 answer
821 views

Read two numbers and return a sum, in PIC24 Assembly

...
btrballin's user avatar
  • 121
3 votes
1 answer
114 views

Improving efficiency and flow by changing subroutine orders

A batch file executes WinSCP.exe's console mode to download files and log the actions. Upon exit, WinSCP returns: ERRORLEVEL 0 if the files are successfully ...
UserUnknown's user avatar
3 votes
2 answers
178 views

Verb tense parser

I have written this Perl code, and there is still more to add, however I was hoping that I could get some opinions on whether it could be written better. Specifically, there is a central ...
Jon's user avatar
  • 185
4 votes
2 answers
338 views

Is calling a function only twice a good use of recursion?

Is this, technically, a recursive function? It only gets called once by itself, but it cleaned up my code quite a bit, I think. Or, does it needlessly complicate the code? ...
Scott Hoffman's user avatar
14 votes
4 answers
557 views

Subroutine to call other subroutines

I have a Perl application that allows the user to choose between two different formats for data output (and there will likely be more in the near future). In the heart of the algorithm, the code makes ...
Daniel Standage's user avatar