MVLib - Short Writeup - Version 4.0
Strings manipulation routines - Last update: March, 8 2017
Source file available for local users only.
In the second column: I means Integer Function, S means Subroutine.
htmlspecialchar(str) S In the string str all the special character are replace with the corresponding code to be used as html source document.
nameadjust(str) S In the string str all the "_" are replaced with space; the whole string became in lowercase and the first character of each word became uppercase.
extractval(str,v) S Extracts the real value v from the string passed as first argument. The special value -9999.0 is returned if the input string contains non numerical characters.
extractint(str,v) S Same as extractval, but the output value is an integer.
latlon2str(lat,lon,str) S Return the character variable str with a string in the fortmat 38.432N-120.234E where the values of latitudes and longittudes are specified by the real input variables lat and lon.
lat2str(lat,str) S Return the character variable str with a string in the fortmat 38.4N where the values of the latitudes is specified by the real input variables lat.
lon2str(lon,str) S Return the character variable str with a string in the fortmat 38.4E where the values of the longitude is specified by the real input variables lon.
integer2string
(i,len,str)
S integer2string convert the value of integer i in the string str whose lenght will be len. As an example a call with (12,4,str) arguments will return as output the string str='0012'.
getcommandline
(prom,chin,chlen)
S getcommandline routine asks to the user a question with prompt specified by the string prom, the string typed by the user is returned with character variable chin, the lenght of chin is returned by the integer variable chlen.
lenstr(str) I Returns, as output, the actual lenght of string passed as argumenti, "actual" means that the final blanks are not considered.
makefilename(start,n,end,file) S Allows to build in the output string file a filename starting with string start, ending with string end and containing the integer number n; as an example, calling the routine with ('tmp/graf',5,'.gif',file) will return the value "tmp/graf005.gif" in the file string.
makefilename2(start,n,end,ndigit,file) S Identical to the previous one, but the next to last integer argument ndigit allows to specify the number of digit to use; as an example, calling the routine with ('tmp/graf',5,'.gif',4,file) will return the value "tmp/graf0005.gif" in the file string.
strsub(a,b,c) S Substites the stringa a with the string b within the string c
nospace(str) S Eliminates all the blanks in the string passed as argument.
noinspace(str) S Eliminates all the initial spaces in the string passed as argument.
tab2space(str) S Substitues all the tabs character with single space in the string passed as argument.
space2undescore(str) S Substitues all the space character with underscore in the string passed as argument.
no2space(str) S Substitues all the multiple spaces with single space in the string passed as argument.
cv2lower(inp,out) S Returns in the string out the input string inp with all lowercase characters.
cv2upper(inp,out) S Returns in the string out the input string inp with all uppercase characters.
readiarg(n,i) S Read the nth argument passed to the fortran code and return it back in i integer argument. i will contain the special value -9999 if the arguments passed to the fortran code are less than n or if the argument is not written in the correct integer format.
readrarg(n,r) S Read the nth argument passed to the fortran code and return it back in r real argument. r will contain the special value -9999.0 if the arguments passed to the fortran code are less than n or if the argument is not written in the correct integer format.
readsarg(n,str) S Read the nth argument passed to the fortran code and return it back in str character argument. str will contain an empty string if the arguments passed to the fortran code are less than n.
takefields(str,sep,vec,n) S Returns in the character vector vec the n substrings contained in the string str and separated by the substring sep.
nameadjust(str) S Adjust the string passed as argument trasforming the first character of each word in capital letter and the other characters in lowercase
This document has been updated on April 27, 2018 h: 15:01