[Thread Prev][Thread Next][Index]

RE: [ferret_users] Checking the argument in Go script



Thanks for your help. This is some really good information and this should help with my GO scripts. For the moment I can get an immediate readout to the screen as suggested by Ryo, but no doubt will use your ideas in future.

 

Mark

 

From: owner-ferret_users@xxxxxxxx <owner-ferret_users@xxxxxxxx> On Behalf Of Ansley Manke
Sent: Thursday, 22 December 2022 6:02 AM
To: ferret_users@xxxxxxxx
Subject: Re: [ferret_users] Checking the argument in Go script

 

Here's a good discussion about arguments to jnl scripts:

../../documentation/users-guide/introduction/GO-FILES.html#_VPINDEXENTRY_126, especially the section "Arguments to GO tools".  Arguments are Ferret symbols, so symbol parsing and substitution syntax works here.

One thing I often want to do is to check whether the argument has been given, and if so, does it have a valid value.  Says I'm expecting a value for the year in argument 1.

This says, assign the value of the argument to a variable. If they didn't send in a value, then assign 0 to my variable. Then the script can check to see if that's a valid value. (The parentheses


[Thread Prev][Thread Next][Index]