PBDR.COM

About   -   Contact   -   Purchase   -   Search   -   What's New

 
 
How to write a GetItemAny Function
I was working with integrating PB with VBScript but because there is no concept of structures in VBScript I could not return a structure of data back from a get data function call. I toyed with the idea of exposing the datastore object and allowing the VBScript to access the data directly but this would be too dangerous so I wrapped the datastores in a custom non visual object and provided a set of functions to allow access to the datastore. One was the getitem function which is listed below. This function allows protected calls to the datastore to get any row/column combination, an overloaded version to allow column number was also provided.

Long ll_Col
Any la_A

IF al_Row > ids_ds.RowCount() THEN RETURN ""
ll_Col = Long( ids_ds.Describe( as_Column + ".ID" ) )
IF ll_Col > 0 THEN &
   la_A = ids_ds.object.data.primary.current[ al_Row, ll_Col ]

RETURN la_A

This example shows how you could implement a GetItemAny function for your datawindow/datastore ancestor and shows the PB5 dot notion being used to access the primary buffer.

 

Top of Page

Legal Notice

Ken Howe 2011