WxLive show notes for May 4 2012
Streaming video training
Glenn Rathke talked about his company's new streaming video training course, which is based on the manual and the examples from the in-person course.Â
The course contains over 11 hours of new video and numerous real-world examples. Data for the course can be either MS SQL or Hyperfile. In particular the course includes training in QBE and dynamic business rules.Â
Loopers, by Wolfgang Kirsch
It's been suggested that loopers were first developed for web apps and were then ported to desktop.Â
Loopers at first seem much like a table and have many of the same features for displaying and editing data. But loopers are different in that they let you repeat controls.Â
Wolfgang got interested in loopers because he wanted what was in effect a repeating form, with one instance of the form for each record. His example was a receipt scanner that allowed you to split an expense creating additional records.
Â
There are some tricks to this - if you have code that executes differently for each instance of the control set then you need to deal with the looper itself, which be default returns control attributes as strings. A better approach is to use attributes to return the actual data format. Attributes are defined in the looper control properties on the General tab.Â
To use in-memory data instead of immediately updating the database when a value changes, after you drag the control into the looper you delink the field. In that case you need to have some code that loops through the control instances and updates the database.Â
Wolfgang said he's been told he could use ScreenToFile but so far he's handling each field individually in code.Â
Bob Roos - Arrays and Queues
Bob Roos did the B side of the webinar.Â
One of his first comments when he started using WinDev was that it didn't have Queues the way Clarion does. In fact there are a number of structures you can use to handle lists of data.Â
If you go into the W language functions in the help and the Standard functions, you'll see a section on managing queues, stacks and lists.Â
There are 39 array functions and 11 functions for queues stacks and lists.Â
Queues in WinDev are first in, first out (FIFO). Use Enqueue to add something to the queue, and Dequeue to remove something from the queue.Â
Stacks are LIFO, last in first out. You use Push to add things to the stop and Pop to remove things from the stack.Â
Lists are just collections - more like a Clarion queue in fact. You can insert at arbitrary locations, but it doesn't appear that they are sortable.Â
You can have lists, queues etc of structures as well as single types.Â
Associative arrays
The real power, according to Bob, is in associative arrays.Â
The subscript of an associative array is not a number but a string. Setting a value on an associative array is the equivalent of doing a Get on a Clarion queue and adding the record if not found, otherwise updating the record.Â
You can invert the array as well so you can do lookups both ways.Â
Associative arrays are very handy for all kinds of lookups.Â
You can't yet sort associative arrays, but Bob showed a way around this by moving data to a regular array and sorting that.Â
You can also create simple arrays which are resizable and sortable, although Bob had some trouble getting column sorting to work right.Â
You can create fixed arrays as well. You may need these for Windows API calls, for instance.Â
Bob didn't go into dynamic arrays, which the help indicates can have dimensions added at runtime.Â
Â