How exactly does that work?
Do you have any sample code?
Namespace support for easy code reuse?
- SparrowhawkMMU
- Posts: 291
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: Namespace support for easy code reuse?
Do you mean Modules or is there a new feature in v2?
Re: Namespace support for easy code reuse?
look on https://www.spiderbasic.com/
by Features (scroll down)
by Features (scroll down)
- SparrowhawkMMU
- Posts: 291
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: Namespace support for easy code reuse?
Looks to me like that is probably referring to Modules as that is how SB and PB do namespacing.
I build all my code in modules, mainly for separation of concern but also for some reuse. Eg I have a DateTime module for some date functions not yet supported by SB, a Registry module for a global dictionary, I'm working on a local storage module, etc.
I tend to have a separate file for each module declaration too for maximum flexibility. Then my main file simply includes all the required files before opening the first window.
Edit: typos
I build all my code in modules, mainly for separation of concern but also for some reuse. Eg I have a DateTime module for some date functions not yet supported by SB, a Registry module for a global dictionary, I'm working on a local storage module, etc.
I tend to have a separate file for each module declaration too for maximum flexibility. Then my main file simply includes all the required files before opening the first window.
Edit: typos
Last edited by SparrowhawkMMU on Wed Nov 16, 2016 10:53 am, edited 1 time in total.
Re: Namespace support for easy code reuse?
Nowhere in the docs its saying that 'Namespace' is the same as 'Modules'.
Fred, can you shed some light on this?
Fred, can you shed some light on this?
- SparrowhawkMMU
- Posts: 291
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: Namespace support for easy code reuse?
From: https://www.spiderbasic.com/documentati ... odule.htmlIn some other programming languages, modules are known as 'namespaces'.
I suspect Fred uses namespaces on the home page as that is the more common term in use outside of SB/PB. Although Xojo also uses modules to namespace, iirc
Re: Namespace support for easy code reuse?
I understand now my own confusion....
When i search on some keyword in the docs it will light up in blue. When i did search for namespaces it will not light up in the docs, because its in brackets...
When i search on some keyword in the docs it will light up in blue. When i did search for namespaces it will not light up in the docs, because its in brackets...