User Tools

Site Tools


namespaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
namespaces [2018/01/22 05:53]
wolfgangriedmann
namespaces [2018/08/20 04:07] (current)
wolfgangriedmann
Line 6: Line 6:
  
 Customer.Item.prg Customer.Item.prg
-<​code>​begin namespace Customer+<​code ​visualfoxpro>begin namespace Customer
  
 class Item class Item
Line 17: Line 17:
  
 Supplier.Item.prg Supplier.Item.prg
-<​code>​begin namespace Supplier+<​code ​visualfoxpro>begin namespace Supplier
  
 class Item class Item
Line 29: Line 29:
 and now how to use these classes: and now how to use these classes:
  
-<​code>​local oCustomerItem as Customer.Item+<​code ​visualfoxpro>local oCustomerItem as Customer.Item
 local oSupplierItem as Supplier.Item local oSupplierItem as Supplier.Item
  
Line 36: Line 36:
  
 Please note that with the "​using"​ statement you don't need to fully specify the class like in this code: Please note that with the "​using"​ statement you don't need to fully specify the class like in this code:
-<​code>​using Customer+<​code ​visualfoxpro>using Customer
 local oItem as Item local oItem as Item
  
 oItem := oItem{}</​code>​ oItem := oItem{}</​code>​
 For the compiler, it must be clear which class to use, so if you have use classes that are defined multiple times in different namespaces, you need to fully qualify them. The following code will lead to a compiler warning: For the compiler, it must be clear which class to use, so if you have use classes that are defined multiple times in different namespaces, you need to fully qualify them. The following code will lead to a compiler warning:
-<​code>​using Customer+<​code ​visualfoxpro>using Customer
 using Supplier using Supplier
  
namespaces.txt ยท Last modified: 2018/08/20 04:07 by wolfgangriedmann