Post Reply 
New Version: 2018.02.12 1.4.1.13441
02-22-2018, 08:20 PM (This post was last modified: 02-22-2018 08:26 PM by Han.)
Post: #33
RE: New Version: 2018.02.12 1.4.1.13441
Create your own custom 'store' and 'recall' functions that handle the data types you need. For example, you can create a RECSTO(record, recnum, label, value) function and RECRCL(record, recnum, label) to return the desired value.

Each record object should have the following structure:

{
{ "label1", "label2", ... , "labeln" },
{ value1_1, value1_2, ..., value1_n }, // this is the first record
{ value2_1, value2_2, ..., value2_n }, // this is the second record
...
}

The RECSTO function should use the supplied 'label' to find the appropriate index (using the first list in each record) for the value. So RECTSTO("MyRec", 2, "NAME", "Tom") should basically do something like:

records:=AFiles(record); // here record="MyRec"
labels:=records(1); // first list is always labels list
n:=POS(labels,label); // here label="NAME";
current:=records(recnum+1);
current(n):=value; // here value="Tom";
records(recnum+1):=current;
AFiles(record):=records;

Everything is generic. A long time ago I wrote a short how-to on creating dynamic variables; this is based on that idea.

http://www.hpmuseum.org/forum/thread-3362.html

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: New Version: 2018.02.12 1.4.1.13441 - Han - 02-22-2018 08:20 PM



User(s) browsing this thread: 1 Guest(s)