[Swift-devel] arguments to swift

Mihael Hategan hategan at mcs.anl.gov
Tue May 1 14:55:30 CDT 2007


This is undocumented and unsupported, but:
@arg("NUM")

You pass it after the .dtm|.swift name:

swift x.swift -NUM=5


On Tue, 2007-05-01 at 14:53 -0500, Veronika V. Nefedova wrote:
> Hi,
> 
> I couldn't find info on how to pass the arguments to the swift script. For 
> example, I need to pass an integer, say NUM=5 on the command line when I am 
> invoking swift. And inside swift script I'd like to address that variable 
> (is it @arg(NUM) ?)... I tried several variations but none seems to work. 
> Could somebody please point me to the documentation or give me an example 
> on how to do that?
> 
> This is one of the few syntax that I tried (and it didn't work):
> 
> inside swift script (how to address it):
> 
> type file{}
> int N = @arg(NUM);
> int range[] = [1:N];
> 
> foreach i in range {
> BLA
> }
> 
> and on the command line - how to specify an argument:
> swift bla.swift NUM=2
> 
> Thanks!
> 
> Nika
> 
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 




More information about the Swift-devel mailing list