How to Include .Swift File from Other .Swift File in an Immediate Mode

How do I import other Swift files into a Swift script?

There's currently no way to import other swift files in a interpreted swift script. But you can concatenate all source files before executing them:

cat one.swift two.swift three.swift | swift -

If you're using the swift compiler, just add the files you want to compile together before the -o argument:

swiftc one.swift two.swift three.swift -o combined

No need to import them, they are already in the same module.

How to develop in Swift without Xcode IDE

You just need to do:

$ swift HelloWorld.swift

And you HelloWorld.swift:

class HelloWorld {
func greet() {
print("Hello World")
}
}
var h = HelloWorld()
h.greet()

Important: as of Swift 1.2 you can only have one big scripting file. Reference

PHP with SQL Server 2005+

You have two options:

1) php_mssql extension : If you'd like something that has the same API mysql and mysqli has, then use the php_mssql extension. But there is a catch, the bundled ntwdblib.dll file with PHP is not working. You have to find this file from a SQL Server 2000 installation or you can find it on the Internet. This API is supposedly not very reliable but I have been using it without problem for about one year.

http://ca.php.net/mssql

2) Microsoft SQL Server 2005 PHP Driver : If you'd like something more modern but which does not have the same API and is missing some important functions (mssql_num_rows). The big plus is that it is supported by Microsoft and is likely to work with a future version.

http://msdn.microsoft.com/en-us/data/cc299381.aspx



Related Topics



Leave a reply



Submit