Jason T. Slack wrote:
I am coming from a Java and C++ background.
I am trying to do:
<%
query([Person];[Person]LastName="S@")
for each(<something goes here!!; $i)
writebr('$i. [Person]FirstName')
end for each
%>
How do I assign a query result to a recordset (or something) so that I
can store the information or traverse it?
4D automatically assigns query results to what is known as the "current
selection". In the example I sent previously I used the current selection.
Active4D has added support for RowSets
From the docs:
At the heart of a RowSet is the data source. The data source acts as the
conduit
between the actual row data and the RowSet API. Currently there are three
possible data sources for a RowSet:
* Selection of records
* Arrays
* Delimited text data
I am used to Java were I run a query, store it in a recordset and then
pass that recordset around.
The Active4D and 4D languages aren't object-oriented. As Aparajita
extends the 4D language in Active4D he is adding some OOP-like features.
Search the docs for "Creating a Poor Man’s Class".
With the rowset implementation, you can pass that rowset reference
around, but the iteration mechanism differs from your example.
The documentation has the details. See the Standard Libraries >> RowSet.
I want to query [Person] to get all the last names that start with "S"
for example.
Your query is correct.
-- Brad
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/