Clarion Folk Lore #3 is live!
[audio:ClarionFolkLore-003.mp3]URLs
- Top Blog Post:
- Negative Criticism post – http://tymesaid.com/negative-critisism-comes-in-all-forms-deal-with-it
- Top Web Site:
- Viget, Design blog – http://www.viget.com/inspire/
- News:
- NetTalkCentral – http://www.nettalkcentral.com
- Outside The Blue Triangle:
- Google Application Engine – http://code.google.com/appengine/
- Team Viewer – http://www.teamviewer.com
Answers
- What does MEMBER() do vs. MEMBER(‘MyApp.clw’)
Every module needs to either have a PROGRAM statement or a MEMBER statement.
The main module of an EXE/DLL/LIB will have the PROGRAM statement. All others will have a MEMBER statement of some form.
– The form, MEMBER(‘MyApp.CLW’) tells the module to use the global scope of MyApp.CLW
– The form, MEMBER() has no shared scope what so ever. This form is useful for generic code, these days typically for CLASSes
- What is the purpose of having a MAP, when it has no procedures in it?
A MAP is used to declare prototypes for procedure. However an empty MAP isn’t quite as empty as it seems.
Every MAP brings in %cwroot%\\libsrc\\BUILTINS.CLW
soMAP
ENDbecomes
MAP
INCLUDE(‘BUILTINS.CLW’),ONCE
ENDOther files that are brought in:
– EQUATES.CLW (found in %cwroot%\\libsrc)
– Win32.LIB (found in %cwroot%\\lib) - How do you make a QUEUE of QUEUEs ?
You’ll need to use ,TYPEd Queues, and you’ll (typically) use NEW / DISPOSE .
At it’s core:
qtChild QUEUE,TYPE
Name STRING(42)
ENDParentQ QUEUE
ID LONG
Children &qtChild
ENDHere a field of the ParentQ is a reference to another queue. Typically as you’re doing the ADD()s to the parent, you’ll either:
a) ParentQ.Children &= NULL
b) ParentQ.Children &= NEW qtChild !instantiate a new one
c) ParentQ.Children &= SomeChildQ !already instantiatedRemember when you’ve used NEW to instantiate, you are responsible for the matching DISPOSE, so typically when you’re doing DELETE(ParentQ) or wish to FREE(ParentQ) you will want to first DISPOSE(ParentQ.Children).
qtFolder QUEUE,TYPE
Name STRING(FILE:MaxFileName)
Path STRING(FILE:MaxFilePath)
ShortName STRING(13)
Date LONG
Time LONG
Size LONG
Attrib BYTE
SubFolders &qtFolder
END
Above is an example of a structure for a queue of queues, where the child queue is of the same structure as the parent queue.
These sorts of structures lend themselves to recursive coding, however it’s not required.