Edit Table (OpenInsight 16-Bit Specific)
At 17 MAR 2003 03:20:19PM Bob Yerkes wrote:
I am having some trouble with an edit table in the 16 bit version of OI 3.7.2. When I try to populate a one column edit table from another edit table on the double click event and it loses my values. It inserts the right number of values it just doesn't display the text. So row is blank except for the last value I inserted. I have tried this in the 32 bit version and it works fine. I have many customers in the 16 bit version so upgrade is not financially feasible right now.
$Insert Procedure_Equates
selpos = get_property(@window:'.SOURCE_LIST','SELPOS')
dest = get_property(@window:'.DEST_LIST','LIST')
source = get_property(@window:'.SOURCE_LIST','LIST')
if dest "" then
dest= source: @fm :dest
end else
dest=source
end
x=set_property(@window:'.DEST_LIST','LIST',dest)
Is there a better way to do this or a work around?
Bob
At 17 MAR 2003 04:12PM Bob Yerkes wrote:
After 2 1/2 hours of playing with it I found the problem. I set sorted column property on create event. I guess this doesn't work in OI 3.7.2.
![]()
Is there a function for sorting an array in memory?
At 17 MAR 2003 04:45PM Oystein Reigem wrote:
Bob,
Is there a function for sorting an array in memory?
Sure. V119.
Say Data contains a @FM-delimited array. Say you want to do a left justified (text) sort on the elements of Data. Then do:
convert @FM to @RM in Data /* V119 needs @RM-delimited data */
Data := @RM /* V119 needs the data to have a trailing @RM */
V119( "S", "", "D", "L", Data, "" )
Data-1, 1=" /* remove trailing @RM */
convert @RM to @FM in Data
See the online help for more info on V119.
- Oystein -
At 17 MAR 2003 04:59PM Richard Bright wrote:
Bob,
Get to know V119 - it's exceptionally fast. MUCH faster than any other sorting routine in Arev / OI and certainly better than sorting the edit table later.
Richard Bright
BrightIdeas New Zealand
At 17 MAR 2003 06:00PM Bob Yerkes wrote:
Thanks for the information it was extremely helpful. Strange name for a subroutine, would never have found it without a little help.
Thanks,
Bob
At 17 MAR 2003 06:31PM Oystein Reigem wrote:
Bob,
Strange name for a subroutine, …
Yes.
Working with Revelation products sometimes feel like being in a cult.
…would never have found it without a little help.
I'll do my bit to help future developers find V119 by mailing Ira Krakow , who's doing a major overhaul of the online help. I'll suggest he adds a suitable keyword "Sorting" or something, pointing to the V119 article.
- Oystein -
At 17 MAR 2003 07:08PM Richard Hunt wrote:
The "V119" and similar named subroutines were created way back in like the 1980's. Back then there was the classic 8 character maximum filename length. That is why the "verbs" were numbered like that.
Way back then, there were other companies like Revelation. All using software from "Cosmos" for "pick" based PC software. Or something like that. At first it was that all basic programs that needed to be compiled must be in "type 1" (or directory type) files. That is how the 8 character maximum length filename limit comes in to play. It wasn't until 1995 (fow windows operating systems) that the 8 character filename limit was increased to 250 characters. And still then there were actual character restrictions.
So since this program V119 (sorter) has not been modified since 1987 (I think), and since there are like 37 programs using that subroutine, they never changed the name.
By the way… read carefully thru the help on the V119 subroutine. Sometimes the wording is a bit tricky.
If your complete sort list is less than 65530 bytes long then you can use the series of function codes as follows… I,S,E,D. If it is greater than 65530 then you must use the series of function codes with looping as follows… I,S,W,M,L,D. The brackets show looping.
At 18 MAR 2003 11:26AM Richard Guise wrote:
Bob
For those of us who cut our teeth on ARev (or even G2B) there are lots of routines in OI which have been largely transferred from ARev and many work much the same way. They can be very useful indeed but V119 is one of the few which is documented. Also the file system and indexing are virtually identical.
You may have heard in this forum of a strange outfit called Sprezzatura and their online publication called SENL. Its AREV predecessor was a little monthly newsletter which ran for about four years in the early 90s and exposed the innermost workings of these things. An online version was produced. Rumour has it that the keenest subscribers were the authors of ARev finding out what they'd done!
If you speak very nicely indeed to AMcA (and send him payment in blood, sweat or other international currency) he might even flog you a copy. My set is still my ARev/OI Bible.
Hope this helps.
At 18 MAR 2003 11:48AM [url=http://www.sprezzatura.com" onMouseOver=window.status= Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:
It's all available FOC on line at our web site
World Leaders in all things RevSoft
At 18 MAR 2003 04:33PM Richard Bright wrote:
To the best of my knowledge, V119 has been updated in the 32 bit version (OIv4.x) such that you do not have to loop thru for strings exceeding 65530 bytes long. This certainly applies to Btree.Extract. These changes in OI v4.x (eliminating the string limitations) have made 32bit programming sooo much easier.
BTW V119 is /was originally written in assembler thus lightning fast.
If you are into sorting thru arrays faster then the following routine is excellent.
compile FUNCTION SEQ_DYN(charstr DYN_ARRAY, charstr DELIM, charstr POSITION)
/
* Author R T I
Date 01 April 1994* Purpose: A Function to allow fast sequential access
through a dynamic array* Revised 1 July 94 - for OI
* see RTI Bulletin #89 P2
*/ ! begin condition pre: post: end condition * DUM=DYN_ARRAYPOSITION,"F":DELIM POSITION=COL2() + 1 RETURN DUM End of routine * Its use is demonstrated in the below code used for sorting list of record keys according to selected dictionary values. Note the list truncation is for 16bit system ie OIv3.7 Subroutine ARK_Sort_Keys(Table, Column, List) /* Sorts a list of keys delim @fm acording to Dict Name or Dict No. Handles multi-sort Max 2,000 compound sorts or 54000 sequential keys –] 64K CopyWrite R T Bright Revised 6 May 01 v 1.0.1 */ Declare Function Seq_Dyn Declare subroutine V119, Send_Info Equate Dict_Type$ to 1 Equate FIELDS_NAME$ to 3 Equate FIELDS_FIELD_NO$ to 5 Equate Dict_Just$ to 10 Sort_Just=' Sort_Dir =' Work =' If List then If Index(List,@fm,1) then * Need to ensure Column is dict Col Num Dict_Rec=Xlate('DICT.':Table,'%FIELDS%',
,'X') Convert ', ':@vm to @fm:@fm:@fm in Column Convert @Lower_Case to @Upper_Case in Column ColN=Count(Column,@fm) + (Column NE
) ColS=' * Determine sort order For N=1 to ColN Locate Column in Dict_Rec setting Pos then Sort_Just := Dict_Rec If Dict_Rec=F' else ColS += 1 End End Else Locate Column in Dict_Rec setting Pos then Sort_Just := Dict_Rec End Else * Remove this value - not field? Sort_Just := 'R' End End Sort_Dir := 'A' Next N * Need to sort in order Info=' Overdone=' Pos=1 M =1 If ColS then Loop Val=SEQ_DYN(List,@fm,Pos) While val Until Overdone * Loop here to assmble fields String =' For N=1 to ColN String:= Xlate(Table,Val,Column,'X'):@fm Next N Work:= String:Val:@rm * Test Length on every 20 time If Mod(M,20) then If Len(Work) ] 60000 then OverDone=1 Send_Info('Truncating sortlist….') End End M+=1 Repeat End Else * This branch for realfields - 20% faster Loop Val=SEQ_DYN(List,@fm,Pos) While val Until Overdone * Loop here to assmble fields String =' For N=1 to ColN String:= Xlate(Table,Val,Column,'X'):@fm Next N Work:= String:Val:@rm * Test Length on every 20 time If Mod(M,20) then If Len(Work) ] 60000 then OverDone=1 Send_Info('Truncating sortlist….') End End M+=1 Repeat End SortFile=C:\Mysort' * - Initialise V119('I',Sortfile,,
,,Flag) * - Sort V119('S',Sortfile,Sort_Dir,Sort_Just,Work,Flag) * - Extract V119('E',
,,
,Work,) * - Tidy up V119('D',Sortfile,
,,
,'') Work-1,1=' Transfer Work to List End End Return * End of routineHTH
Richard Bright
BrightIdeas New Zealand
r.bright@ark.co.nz