Login   Register  
PHP Classes
elePHPant
Icontem

File: Liste.tst.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gilbert BENABOU  >  ABG List  >  Liste.tst.php  >  Download  
File: Liste.tst.php
Role: Example script
Content type: text/plain
Description: Test script
Class: ABG List
Manage linked lists of values
Author: By
Last change:
Date: 4 years ago
Size: 1,946 bytes
 

Contents

Class file image Download
<?php
################################################################################
#  Project : ABG_Liste                                                         #
#  File    : Liste.tst.php                                                     #
#  V1.1.0 23/03/2010   : Initial                                               #
#  (cy)  G. BENABOU / ABG Soft PARIS FRANCE                                    #
#                                                                              #
#  Mamging simply linked list in PHP                                           #
#                                                                              #
#=== IMPORTS ==================================================================#
#   ABG_List     class in ABG_Liste.cls.php                                    #
#                                                                              #
################################################################################

  ### A P P L I C A T I O N  ###################################################
  
include_once('ABG_Liste.cls.php');
  try{
    
$MyList = new ABG_List(array( array('X0',1),         // Initial liste
                                  
array('X1',2),
                                  array(
'X2',3),
                                  array(
'X3',4),
                                  array(
'X4',5),
                                  array(
'X5',null)
                               )
                          );
    
$MyList->ListInsertAfter(2'33');                  // Modifications
    
$MyList->ListDelete(0);
    
$MyList->ListInsertFirst('00');
    
$MyList->ListInsertAfter(0'11');
    
$MyList->ListDelete(0);
    
$MyList->ListInsertFirst('AA');
    
$MyList->ListSetData(2'22');
    
$MyList->ListDelete(7);
  } catch(
Exception $Exc_){
    
$Msg "<br />\n***<b >Error : </b>".$Exc_->getMessage()."***";
    print(
$Msg);
  }
?>