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.