Re: Sample program using STL Container (MAP)


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Grant Foraker on August 17, 2018 at 11:51:44:

In Reply to: Sample program using STL Container (MAP) posted by Robert G Laurin on August 14, 2018 at 12:27:33:

=========================================================================
DO
LET IND = RND(IND) * 100 ! Generate Random Number 0-99
KEY$ = STR(IND)
COUNT = COUNT + 1
DATA$ = STR(IND) + STR(COUNT) ! Data is Key + Order of which is was generated
stlSet(mySTL, KEY$, DATA$) ! Write in Random Order
Loop While COUNT < 100 ! Do it a hundred times

stlBegin(mySTL) ! STL POS=BOF

Let COUNT = 0
Do
DATA$ = stlRead(mySTL) ! Get Data from STL
Let COUNT = COUNT + 1
Print COUNT;':';DATA$
stlNext(mySTL) Excp=Excp.EOF ! Advance STL Pointer Excp=EOF
Loop
=============================================================
For MAP clarification ...

1) stlSet(mySTL, KEY$, DATA$) - there can only one data field? The ability to use a FORMAT would be nice.

2) DATA$ = stlRead(mySTL) - straight sequential read with no "file pointer" advance? And, one field as in #1?

3) Would stlGet look like "DATA$ = stlGet(mySTL, KEY$)". Is this like a POSITION and I'd have to follow it with a stlRead?

I suppose that you could get "FORMAT" like results by READ/WRITE into the # Buffer.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]