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:
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
DATA$ = stlRead(mySTL) ! Get Data from STL
Let COUNT = COUNT + 1
stlNext(mySTL) Excp=Excp.EOF ! Advance STL Pointer Excp=EOF
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.
Post a Followup
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.