Hot Flields in a Relational Tree List

clarion

    Next

  • 1. Adding records
    I would like to select a record in a browse and add it to a queue using drag and drop. However, the record must still be available in the browse, so the entry in the queue must only be a copy. I don't know how to do this. Can someone please help? Regards Nazla
  • 2. CW5 Crashes with Win2k
    Hi Everyone, recently I install my CW5.0a in Windows 2000. After entering the serial number, It worked fine. But when i restart my computer, it cant work any more. A message said "ntvdm.exe-Application error", "The instruction at 0x77cbacc referenced memory at 0x0552009a...". Anyone has any idea? Any help would be great appreciated! Thanks . Allan
  • 3. Applying New Templates
    I have added a new template by registering the template on CW5. My problem is that when I open my application I select the Template Utility and the new registered template does not display in the selection table (only a few of the registered templates are displayed for selection). How can I add the new template to my application? Thanks, Robert
  • 4. Determining viewed entry pointer in List Box
    List{PROP:Item} tells me how many records are in view in the List control but how can I tell which records are in view in the list box at any moment? Thanks in advance :) charles (at) fpgatools.com
  • 5. FunctionCallCalendar template
    hi, I'm using Clarion ABC. I want to use FunctionCallCalendar of ClassABCFree as a calendar lookup but I want to limit the month to be displayed in the calendar, ex. February 2004 only. Is this possible ? If yes then how will I do it? Many thanks. Clarion Programmer

Hot Flields in a Relational Tree List

Postby Dick Baltes » Thu, 22 Jul 2004 07:13:55 GMT

Does any body know how to do hot fields in a relational tree list box.
Worked on it for about an hour then hit the Jim Beam

Using Clarion 6 legacy

Thanks in advance

Dick



Hot Flields in a Relational Tree List

Postby Dick Baltes » Sat, 24 Jul 2004 09:57:38 GMT

Does any body know how to do hot fields in a relational tree list box.
Worked on it for about an hour -- is there a way

Using Clarion 6 legacy

Thanks in advance

Dick



Similar Threads:

1.tree widget from a list-of-lists

has anyone created a tree widget (bwidget/incr-widget/blt-widget) from a
list-of-lists ?

something like:

set root {
    level-1 {
        level-11 {
    }
}

etc. ?

i appreciate any code fragments to get me rolling.

thanks


2.applie ipod touch iphone watch aire rift hot hot hot

3.B tree, B+ tree and B* tree

I understand what B tree is.  However I don't have any material covering B+
and B* trees.

Is B+ tree also the same as B* tree?

What differences between B tree and  B+/B* trees?

Thanks for your help!


4.tree list box

I have a three tier tree control, but would like to know when I'm on a
specific level of the control, I'm able to get the last value of the
root, but not the one, I'm on.

root-|
     sub1
     sub2
root-|
     sub

How could I find out that sub1 is the one that is highlighted

5.Detection of a loop in a linked tree (or linked list)

I found that with memory allocating techniques used nowadays
(addresses alignment, eg. on 32bit machines) one can detect loops in a
tree structure very fast, without using extra memory. This is due to a
possibility of storing extra information in unused bits of the tree
pointers (it works for linked lists too). One can say it is dangerous
or obvious, but I haven't seen it anywhere, and maybe it will be
useful for someone.

The procedure of loops detection has two steps:
1. Going through the tree with marking visited nodes (in pointers to
them) and checking if every node was visited only once (visiting node
twice means a loop)
2.  Going through the tree once again and fixing tree pointers values,
to get the original tree structure
Below is an example code in C - you need only to add tree creation
function you like.

/*
* BEGINNING OF THE FILE
*/

#include "stdio.h"
#include "ctype.h"
#include "malloc.h"


#define LEAFS 2 //can be any integer >0

typedef struct t {          //simple tree structure
	    int data;
 	    struct t * leafs[LEAFS];
	} tree;

/*
* test for cycles in a tree by using pointers reallignment
*/
int TestTreeAl(tree **root)
{
  int i=0;
  int j;
  tree *p;
  if (*root==NULL) return 0;
  else
  {
     j=((int)(*root))%2;
    if (j!=0) return 1; //if a node is marked with odd pointer - cycle
detected
    p=*root; //remember the correct pointer
    (int)*root=((int)*root)+1;  //mark the node
    for (i=0; i<LEAFS; i++)              //visit all the leafs
       if (TestTreeAl(&(p)->leafs[i])==1) return 1;
  }
  return 0;
}

/*
* fix allignment of tree pointers
*/
void FixTree(tree **root)
{ int i,j;
  if (*root!=NULL)
  {
     j=(int)(*root)%2;
     if (j!=0)
       (int)*root=((int)*root)-1; //unmark previously marked node
     for (i=0; i<LEAFS; i++)
     {
       if ((j!=0) && ((*root)->leafs[i]!=NULL))
         FixTree(&((*root)->leafs[i]));
     }
  }
}

/*
* test linked tree for cycles
* returns 1 if any cycles were detectet, otherwise it returns 0
* (almost no additional memory used, only two visits in each tree
element)
*/
int TestTree(tree *root)
{
  int i=TestTreeAl(&root); //testing for tree cycles with pointers
reallignment
  FixTree(&root);
  return i;
}

/*
 * print all the data from the tree (sequence is not important)
*/
void print_tree_data(tree *root)
{
  int i;
  if (root!=NULL)
  {
    printf("%d\n",root->data);
    for (i=0; i<LEAFS; i++)
      print_tree_data(root->leafs[i]);
  }
}

void main()
{
  tree *root;
  int i;

  printf("* Example of a fast and memory efficient method \n* for
finding cycles in a tree structure (by Maciej Huk)\n\n");

  root=NULL;             //for NULL tree we will have no cycles
  //make_tree(&root);    //You need to define this function yourself

  print_tree_data(root); //if tree was OK, the print makes no problems

  i=TestTree(root);

  printf("Before adding the cycles: ");
  if (i==0) printf("NO CYCLES :)\n");
  else printf("CYCLES DETECTED!\n");

  /*
  * try adding cycles to your tree (beware for the initial tree
structure!)
  */
  //root->leafs[1]->leafs[0]=root->leafs[0]->leafs[1]; //example of a
cycle to try
  //root->leafs[0]->leafs[0]->leafs[0]=root; //...and another one

  i=TestTree(root);

  printf("\nAfter adding the cycles: ");
  if (i==0) printf("NO CYCLES :)\n");
  else printf("CYCLES DETECTED!\n");

  if (i==0) print_tree_data(root); //if there is no cycles we can
easily print the tree

  printf("\n\nPress any key to exit...");
  while (!getch());
}

/*
* END OF THE FILE
*/

Best regards,
Maciej

6. Binary Tree 2 Linked List

7. convert a list to tree

8. Tree as nested list



Return to clarion

 

Who is online

Users browsing this forum: No registered users and 30 guest