Parenthesis Powershell functions

Functions behaves like cmdlets. That is, you don’t type dir(c:\temp). Functions likewise take parameters as space separated and like cmdlets, support positional, named and optional parameters e.g.: Greet Recardo 5 Greet -times 5 -name Ricardo PowerShell uses () to allow you to specify expressions like so: function Greet([string[]]$names, [int]$times=5) { foreach ($name in $names) { … Read more

Does Fortran preserve the value of internal variables through function and subroutine calls?

To answer your question: Yes Fortran does preserve the value of internal variables through function and subroutine calls. Under certain conditions … If you declare an internal variable with the SAVE attribute it’s value is saved from one call to the next. This is, of course, useful in some cases. However, your question is a … Read more

Committing transactions while executing a postgreql Function

This can be done using dblink. I showed an example with one insert being committed you will need to add your while loop logic and commit every loop. You can http://www.postgresql.org/docs/9.3/static/contrib-dblink-connect.html CREATE OR REPLACE FUNCTION log_the_dancing(ip_dance_entry text) RETURNS INT AS $BODY$ DECLARE BEGIN PERFORM dblink_connect(‘dblink_trans’,’dbname=sandbox port=5433 user=postgres’); PERFORM dblink(‘dblink_trans’,’INSERT INTO dance_log(dance_entry) SELECT ‘ || ”” … Read more