<div dir="ltr"><div><div><div>I'm not 100% sure how returning a variable works when the function code is contained within a different script file, but when you call it, the syntax should be something like<br><br></div>
fday2 = 'run /home/aaron/grads/day_abv.gsf 'fday<br><br></div>if that doesn't work, put the function code within the script you're actually running.<br><br></div>Also, you can try making newday a global script variable by renaming it with a leading underscore. Then you may be able to access it from your other script code just by virtue of having run the day_abv function in your script.<br>
<br>Jeff Duda<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 5:12 PM, Perry, Aaron @ LSC <span dir="ltr"><<a href="mailto:Aaron.Perry@lsc.vsc.edu" target="_blank">Aaron.Perry@lsc.vsc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Good Evening All,<br>
<br>
I'm currently trying to create a very simple function script (.gsf) where a weekday is changed from say "Sun" to "Sunday" and then plotted. I have sought help from a few people who are GrADS-proficient and they are as stumped as I am.<br>
<div><br>
Here's what I'm dealing with:<br>
<br>
<b>Function Script:</b><br>
<br>
function convertday(fday)<br>
<br>
rc = gsfallow("on")<br>
<br>
if (fday="Sun"); newday="Sunday"; endif<br>
if (fday="Mon"); newday="Monday"; endif<br>
if (fday="Tue"); newday="Tuesday"; endif<br>
if (fday="Wed"); newday="Wednesday"; endif<br>
if (fday="Thu"); newday="Thursday"; endif<br>
if (fday="Fri"); newday="Friday"; endif<br>
if (fday="Sat"); newday="Saturday"; endif<br>
<br>
return(newday)<br>
<br>
<b>Command to function in main script:</b><br>
<br>
'/home/aaron/grads/day_abv.gsf 'fday''<br>
<br>
<b>How I'm attempting to plot the variable:</b><br>
<br>
'draw string 2.60 8.05 Valid: 'thour' 'tz' ('thour2') 'newday' 'fday2' 'fmonth' 'fyear''<br>
<br>
Also, I'm using <b>'q time' fday = subwrd(result,6)</b> to get the actual weekday name at the top of the main script.<br>
<br>
This function should be working, as it's probably as simple as you could get for a function.<br>
<br>
Any ideas?<br>
<br>
<br>
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">Onward and Upward,<br>
<div style="font-family:Tahoma;font-size:13px"><font size="3"><font face="Arial"><font face="Tahoma"><font><br>
</font>Aaron D. Perry<br>
</font><font size="3"><font size="3"><font face="Tahoma">Atmospheric Sciences<br>
Lyndon State College<br>
Class of 2016<br>
</font></font></font></font></font><font size="3"><font face="Arial"><font size="3"><font size="3"><font face="Tahoma"><font size="3"><font face="Arial"><font size="3"><font size="3"><font face="Tahoma">Boston, MA</font></font></font></font></font>
<br>
Twitter: <a href="https://twitter.com/AaronPerryLSC" target="_blank">@AaronPerryLSC</a><br>
</font></font></font></font></font><font size="3"><font face="Arial"><font size="3"><font size="3"><font face="Tahoma">Mobile: 617-780-4312</font></font></font></font></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>
</div>